diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..217af47
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/description.html b/.idea/description.html
new file mode 100644
index 0000000..cc10d56
--- /dev/null
+++ b/.idea/description.html
@@ -0,0 +1,2 @@
+Simple JavaFX 2.0 application that includes simple .fxml file with attached controller and Main class to quick start. Artifact to build JavaFX application is provided.
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..e206d70
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..157a0c1
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..e8dfabe
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..11a30c4
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..3b00020
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,125 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
+
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..def6a6a
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..dc4e51a
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,926 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Lab3.iml b/Lab3.iml
new file mode 100644
index 0000000..d5c0743
--- /dev/null
+++ b/Lab3.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/out/production/Lab3/sample/Error.class b/out/production/Lab3/sample/Error.class
new file mode 100644
index 0000000..ae47b2d
Binary files /dev/null and b/out/production/Lab3/sample/Error.class differ
diff --git a/out/production/Lab3/sample/error.fxml b/out/production/Lab3/sample/error.fxml
new file mode 100644
index 0000000..10124f7
--- /dev/null
+++ b/out/production/Lab3/sample/error.fxml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/out/production/Lab3/sample/model.class b/out/production/Lab3/sample/model.class
new file mode 100644
index 0000000..7131482
Binary files /dev/null and b/out/production/Lab3/sample/model.class differ
diff --git a/out/production/Lab3/sample/new_window.fxml b/out/production/Lab3/sample/new_window.fxml
new file mode 100644
index 0000000..eb1fcc3
--- /dev/null
+++ b/out/production/Lab3/sample/new_window.fxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/out/production/Lab3/sample/newwindowcontroller.class b/out/production/Lab3/sample/newwindowcontroller.class
new file mode 100644
index 0000000..93df7a0
Binary files /dev/null and b/out/production/Lab3/sample/newwindowcontroller.class differ
diff --git a/out/production/Lab3/sample/sample.fxml b/out/production/Lab3/sample/sample.fxml
new file mode 100644
index 0000000..403a28b
--- /dev/null
+++ b/out/production/Lab3/sample/sample.fxml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/sample/Controller.java b/src/sample/Controller.java
new file mode 100644
index 0000000..a00335f
--- /dev/null
+++ b/src/sample/Controller.java
@@ -0,0 +1,54 @@
+package sample;
+
+
+import javafx.beans.property.ReadOnlyStringProperty;
+import javafx.beans.property.ReadOnlyStringWrapper;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.GridPane;
+import javafx.stage.Modality;
+import javafx.stage.Stage;
+
+import javafx.event.ActionEvent;
+import javafx.stage.Window;
+
+import java.io.IOException;
+import java.lang.IllegalStateException;
+
+
+public class Controller {
+ private ReadOnlyStringWrapper text ;
+ @FXML
+ private Label label;
+ @FXML
+ private AnchorPane pane;
+ @FXML
+ private Button btn;
+ public void initialize() {
+ text= new ReadOnlyStringWrapper(this, "text");
+ text.bind(label.textProperty());
+ }
+ public ReadOnlyStringProperty textProperty() {
+ return text.getReadOnlyProperty();
+ }
+ public String getText() {
+ return text.get();
+ }
+ @FXML
+ void handleButtonAction(ActionEvent event) throws IOException {
+ FXMLLoader fxmlLoader =new FXMLLoader(getClass().getResource("new_window.fxml"));
+ Parent root1=(Parent) fxmlLoader.load();
+ Stage modalStage=new Stage();
+ modalStage.setTitle("Wprowadz imie");
+ modalStage.setScene(new Scene(root1));
+ modalStage.initModality(Modality.WINDOW_MODAL);
+ modalStage.initOwner(btn.getScene().getWindow());
+ modalStage.show();
+ }
+
+}
diff --git a/src/sample/Error.java b/src/sample/Error.java
new file mode 100644
index 0000000..624926d
--- /dev/null
+++ b/src/sample/Error.java
@@ -0,0 +1,16 @@
+package sample;
+
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.scene.control.Button;
+import javafx.stage.Stage;
+
+public class Error {
+ @FXML
+ private Button btn2;
+ @FXML
+ void closeButtonAction(ActionEvent event){
+ Stage stage2 =(Stage) btn2.getScene().getWindow();
+ stage2.close();
+ }
+}
diff --git a/src/sample/Main.java b/src/sample/Main.java
new file mode 100644
index 0000000..df07f47
--- /dev/null
+++ b/src/sample/Main.java
@@ -0,0 +1,35 @@
+package sample;
+
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.stage.Stage;
+
+public class Main extends Application {
+
+
+
+ @Override
+ public void start(Stage primaryStage) throws Exception{
+
+ FXMLLoader primaryLoader = new FXMLLoader(getClass().getResource("sample.fxml"));
+ FXMLLoader secondaryLoader = new FXMLLoader(getClass().getResource("new_window.fxml"));
+ Parent textAreaHolder = (Parent) primaryLoader.load();
+ Parent textAreaUser = (Parent) secondaryLoader.load();
+ Controller primaryController = (Controller) textAreaHolder.getController();
+ newwindowcontroller secondController = (newwindowcontroller) textAreaUser.getController();
+ secondController.textProperty().bind(primaryController.textProperty());
+
+ primaryStage.setTitle("Panel logowania");
+ primaryStage.setScene(new Scene(textAreaHolder, 300, 300));
+ primaryStage.show();
+
+ }
+
+
+ public static void main(String[] args) {
+ launch(args);
+ }
+}
diff --git a/src/sample/error.fxml b/src/sample/error.fxml
new file mode 100644
index 0000000..10124f7
--- /dev/null
+++ b/src/sample/error.fxml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/sample/model.java b/src/sample/model.java
new file mode 100644
index 0000000..c2f3897
--- /dev/null
+++ b/src/sample/model.java
@@ -0,0 +1,20 @@
+package sample;
+
+import javafx.beans.property.SimpleStringProperty;
+import javafx.beans.property.StringProperty;
+
+public class model {
+ private final StringProperty text = new SimpleStringProperty("Initial text...");
+
+ public StringProperty textProperty() {
+ return text ;
+ }
+
+ public final void setText(String text) {
+ textProperty().set(text);
+ }
+
+ public final String getText() {
+ return textProperty().get();
+ }
+}
diff --git a/src/sample/new_window.fxml b/src/sample/new_window.fxml
new file mode 100644
index 0000000..eb1fcc3
--- /dev/null
+++ b/src/sample/new_window.fxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/sample/newwindowcontroller.java b/src/sample/newwindowcontroller.java
new file mode 100644
index 0000000..e104dd8
--- /dev/null
+++ b/src/sample/newwindowcontroller.java
@@ -0,0 +1,57 @@
+package sample;
+
+
+import javafx.beans.property.SimpleStringProperty;
+import javafx.beans.property.StringProperty;
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextField;
+import javafx.stage.Modality;
+import javafx.stage.Stage;
+
+import java.io.IOException;
+
+public class newwindowcontroller {
+
+ private StringProperty text ;
+ @FXML
+ private Button btn1;
+ @FXML
+ private Label lbl1;
+ @FXML
+ private TextField txt1;
+ public void initialize() {
+ text = new SimpleStringProperty(this, "text");
+ }
+ public StringProperty textProperty() {
+ return text ;
+ }
+ public String getText() {
+ return text.get();
+ }
+ @FXML
+ void handleButtonAction(ActionEvent event) throws IOException {
+ String text1=new String();
+ text1=txt1.getText();
+ if (text.equals("")){
+ FXMLLoader fxmlLoader1 =new FXMLLoader(getClass().getResource("error.fxml"));
+ Parent root2=(Parent) fxmlLoader1.load();
+ Stage stage2=new Stage();
+ stage2.setTitle(" 666 critical ERROR");
+ stage2.setScene(new Scene(root2));
+ stage2.initModality(Modality.WINDOW_MODAL);
+ stage2.initOwner(btn1.getScene().getWindow());
+ stage2.show();
+ }
+ else{
+ Stage modalStage =(Stage) btn1.getScene().getWindow();
+ modalStage.close();
+
+ }
+ }
+}
diff --git a/src/sample/sample.fxml b/src/sample/sample.fxml
new file mode 100644
index 0000000..403a28b
--- /dev/null
+++ b/src/sample/sample.fxml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+