├── .gitignore ├── Readme.md ├── javafx-built-in-layout-pane-examples └── src │ └── javafx │ └── example │ ├── borderpane │ ├── BorderPaneApplication.java │ └── layout.fxml │ ├── gridpane │ ├── GridPaneApplication.java │ └── layout.fxml │ ├── hbox │ ├── HBoxExampleApplication.java │ └── layout.fxml │ ├── stackpane │ ├── StackPaneApplication.java │ └── layout.fxml │ └── vbox │ ├── VBoxExampleApplication.java │ └── layout.fxml ├── javafx-css-demo-app ├── Readme.md └── src │ └── javafx │ └── example │ ├── CSSDemoApplication.java │ ├── css_demo.fxml │ ├── demo.css │ └── javafx_account_example.png ├── javafx-hello-world ├── Readme.md └── src │ └── HelloWorldApplication.java ├── javafx-registration-form-application ├── Readme.md └── src │ └── RegistrationFormApplication.java ├── javafx-registration-form-fxml ├── Readme.md └── src │ └── javafx │ └── example │ ├── AlertHelper.java │ ├── RegistrationFormApplication.java │ ├── RegistrationFormController.java │ └── registration_form.fxml └── javafx-toolbar-example ├── Readme.md └── src └── javafx └── example ├── ToolbarDemoApp.java ├── img ├── account-box-outline.png ├── email-outline.png ├── home-outline.png └── note-multiple-outline.png ├── toolbar-demo.css └── toolbar-demo.fxml /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | out 4 | *.iml 5 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # JavaFX Examples Projects 2 | Find the tutorials for all the projects at [The CalliCoder Blog](https://www.callicoder.com) - 3 | 4 | + [JavaFX Hello World Tutorial](https://www.callicoder.com/javafx-desktop-application-development-tutorial/) 5 | + [JavaFX Registration Form GUI Tutorial](https://www.callicoder.com/javafx-registration-form-gui-tutorial/) 6 | + [JavaFX FXML Tutorial](https://www.callicoder.com/javafx-fxml-form-gui-tutorial/) 7 | + [JavaFX Built-in Layout Panes Tutorial](https://www.callicoder.com/javafx-built-in-layout-panes-tutorial/) 8 | + [JavaFX CSS Tutorial](https://www.callicoder.com/javafx-css-tutorial/) 9 | 10 | 11 | -------------------------------------------------------------------------------- /javafx-built-in-layout-pane-examples/src/javafx/example/borderpane/BorderPaneApplication.java: -------------------------------------------------------------------------------- 1 | package javafx.example.borderpane; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | 10 | public class BorderPaneApplication extends Application { 11 | 12 | @Override 13 | public void start(Stage primaryStage) throws Exception{ 14 | Parent root = FXMLLoader.load(getClass().getResource("layout.fxml")); 15 | primaryStage.setTitle("JavaFX Built-in Layout Panes Example"); 16 | primaryStage.setScene(new Scene(root, 800, 500)); 17 | primaryStage.show(); 18 | } 19 | 20 | 21 | public static void main(String[] args) { 22 | launch(args); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /javafx-built-in-layout-pane-examples/src/javafx/example/borderpane/layout.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 21 | 22 |
23 | 38 |
39 | 40 | 49 | 50 |
-------------------------------------------------------------------------------- /javafx-built-in-layout-pane-examples/src/javafx/example/gridpane/GridPaneApplication.java: -------------------------------------------------------------------------------- 1 | package javafx.example.gridpane; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | /** 10 | * Created by rajeevkumarsingh on 26/06/17. 11 | */ 12 | public class GridPaneApplication extends Application { 13 | @Override 14 | public void start(Stage primaryStage) throws Exception{ 15 | Parent root = FXMLLoader.load(getClass().getResource("layout.fxml")); 16 | primaryStage.setTitle("JavaFX Built-in Layout Panes Example"); 17 | primaryStage.setScene(new Scene(root, 600, 340)); 18 | primaryStage.show(); 19 | } 20 | 21 | 22 | public static void main(String[] args) { 23 | launch(args); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /javafx-built-in-layout-pane-examples/src/javafx/example/gridpane/layout.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 13 | 14 | 15 | 18 | 19 | 21 | 22 | 23 | 25 | 26 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /javafx-built-in-layout-pane-examples/src/javafx/example/hbox/HBoxExampleApplication.java: -------------------------------------------------------------------------------- 1 | package javafx.example.hbox; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | public class HBoxExampleApplication extends Application { 10 | 11 | @Override 12 | public void start(Stage primaryStage) throws Exception{ 13 | Parent root = FXMLLoader.load(getClass().getResource("layout.fxml")); 14 | primaryStage.setTitle("JavaFX Built-in Layout Panes Example"); 15 | primaryStage.setScene(new Scene(root, 600, 340)); 16 | primaryStage.show(); 17 | } 18 | 19 | 20 | public static void main(String[] args) { 21 | launch(args); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /javafx-built-in-layout-pane-examples/src/javafx/example/hbox/layout.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 12 | 15 | 18 | 21 | -------------------------------------------------------------------------------- /javafx-built-in-layout-pane-examples/src/javafx/example/stackpane/StackPaneApplication.java: -------------------------------------------------------------------------------- 1 | package javafx.example.stackpane; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | /** 10 | * Created by rajeevkumarsingh on 26/06/17. 11 | */ 12 | public class StackPaneApplication extends Application { 13 | @Override 14 | public void start(Stage primaryStage) throws Exception{ 15 | Parent root = FXMLLoader.load(getClass().getResource("layout.fxml")); 16 | primaryStage.setTitle("JavaFX Built-in Layout Panes Example"); 17 | primaryStage.setScene(new Scene(root, 600, 340)); 18 | primaryStage.show(); 19 | } 20 | 21 | 22 | public static void main(String[] args) { 23 | launch(args); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /javafx-built-in-layout-pane-examples/src/javafx/example/stackpane/layout.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 15 | -------------------------------------------------------------------------------- /javafx-built-in-layout-pane-examples/src/javafx/example/vbox/VBoxExampleApplication.java: -------------------------------------------------------------------------------- 1 | package javafx.example.vbox; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | public class VBoxExampleApplication extends Application { 10 | 11 | @Override 12 | public void start(Stage primaryStage) throws Exception{ 13 | Parent root = FXMLLoader.load(getClass().getResource("layout.fxml")); 14 | primaryStage.setTitle("JavaFX Built-in Layout Panes Example"); 15 | primaryStage.setScene(new Scene(root, 600, 340)); 16 | primaryStage.show(); 17 | } 18 | 19 | 20 | public static void main(String[] args) { 21 | launch(args); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /javafx-built-in-layout-pane-examples/src/javafx/example/vbox/layout.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /javafx-css-demo-app/Readme.md: -------------------------------------------------------------------------------- 1 | # JavaFX CSS Example -------------------------------------------------------------------------------- /javafx-css-demo-app/src/javafx/example/CSSDemoApplication.java: -------------------------------------------------------------------------------- 1 | package javafx.example; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | 10 | public class CSSDemoApplication extends Application { 11 | 12 | @Override 13 | public void start(Stage primaryStage) throws Exception { 14 | Parent root = FXMLLoader.load(getClass().getResource("css_demo.fxml")); 15 | Scene scene = new Scene(root, 800, 450); 16 | scene.getStylesheets().add(getClass().getResource("demo.css").toExternalForm()); 17 | primaryStage.setScene(scene); 18 | primaryStage.show(); 19 | } 20 | 21 | public static void main(String[] args) { 22 | launch(args); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /javafx-css-demo-app/src/javafx/example/css_demo.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
38 | 39 | 40 | 41 | 46 | 47 | 48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 |
-------------------------------------------------------------------------------- /javafx-css-demo-app/src/javafx/example/demo.css: -------------------------------------------------------------------------------- 1 | .root { 2 | -fx-font-size: 14px; 3 | -fx-font-family: sans-serif; 4 | -fx-background-color: #ffffff; 5 | } 6 | 7 | .header-section { 8 | -fx-padding: 10px; 9 | -fx-font-size: 20px; 10 | -fx-background-color: teal; 11 | } 12 | 13 | .header-section Label { 14 | -fx-text-fill: #ffffff; 15 | -fx-padding: 10px; 16 | } 17 | 18 | #account { 19 | -fx-background-color: transparent; 20 | -fx-text-fill: #ffffff; 21 | -fx-font-size: 16px; 22 | -fx-cursor: hand; 23 | } 24 | 25 | .sidebar-section { 26 | -fx-min-width: 200px; 27 | -fx-pref-width: 200px; 28 | -fx-max-width: 200px; 29 | -fx-border-width: 1; 30 | -fx-border-color: transparent #E8E8E8 transparent transparent; 31 | } 32 | 33 | .sidebar-section Label { 34 | -fx-font-size: 18px; 35 | -fx-padding: 10 15 10 15; 36 | -fx-border-width: 1; 37 | -fx-border-color: transparent transparent #E8E8E8 transparent; 38 | -fx-min-width: 200px; 39 | -fx-pref-width: 200px; 40 | -fx-max-width: 200px; 41 | } 42 | 43 | .content-section { 44 | -fx-padding: 10 20 10 20; 45 | -fx-wrap-text: true; 46 | 47 | } 48 | 49 | #content-header { 50 | -fx-font-size: 18px; 51 | -fx-padding: 0 0 10 0; 52 | -fx-font-weight: 700; 53 | } 54 | 55 | #content { 56 | -fx-wrap-text: true; 57 | -fx-font-size: 16px; 58 | } 59 | 60 | #footer-section { 61 | -fx-alignment: center; 62 | -fx-padding: 10 10 10 10; 63 | -fx-border-width: 1; 64 | -fx-border-color: #E8E8E8 transparent transparent transparent; 65 | } -------------------------------------------------------------------------------- /javafx-css-demo-app/src/javafx/example/javafx_account_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callicoder/javafx-examples/d0a1a9cf7ac634508a47db5bfb70124947c36415/javafx-css-demo-app/src/javafx/example/javafx_account_example.png -------------------------------------------------------------------------------- /javafx-hello-world/Readme.md: -------------------------------------------------------------------------------- 1 | ## JavaFX Hello World Example with Lifecycle Methods 2 | 3 | The Project contains a Simple JavaFX Hello World example with implementation of all the lifecycle methods. 4 | 5 | Compile and run `HelloWorldApplication.java` for running the program. 6 | 7 | ## Tutorial 8 | 9 | You can find the tutorial for this application on my blog - 10 | 11 | -------------------------------------------------------------------------------- /javafx-hello-world/src/HelloWorldApplication.java: -------------------------------------------------------------------------------- 1 | import javafx.application.Application; 2 | import javafx.geometry.Pos; 3 | import javafx.scene.Scene; 4 | import javafx.scene.control.Label; 5 | import javafx.stage.Stage; 6 | 7 | public class HelloWorldApplication extends Application { 8 | 9 | @Override 10 | public void init() throws Exception { 11 | super.init(); 12 | System.out.println("Inside init() method! Perform necessary initializations here."); 13 | } 14 | 15 | @Override 16 | public void start(Stage primaryStage) throws Exception { 17 | Label label = new Label("Hello World"); 18 | label.setAlignment(Pos.CENTER); 19 | Scene scene = new Scene(label, 500, 350); 20 | 21 | primaryStage.setTitle("Hello World Application"); 22 | primaryStage.setScene(scene); 23 | primaryStage.show(); 24 | } 25 | 26 | @Override 27 | public void stop() throws Exception { 28 | super.stop(); 29 | System.out.println("Inside stop() method! Destroy resources. Perform Cleanup."); 30 | } 31 | 32 | public static void main(String[] args) { 33 | launch(args); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /javafx-registration-form-application/Readme.md: -------------------------------------------------------------------------------- 1 | ## JavaFX Registration Form Example 2 | 3 | The Project explains how to create a Registration form in JavaFX. 4 | Compile and run `RegistrationFormApplication.java` for running the program. 5 | 6 | ## Tutorial 7 | 8 | Checkout the following tutorial for this application - 9 | 10 | -------------------------------------------------------------------------------- /javafx-registration-form-application/src/RegistrationFormApplication.java: -------------------------------------------------------------------------------- 1 | import javafx.application.Application; 2 | import javafx.event.ActionEvent; 3 | import javafx.event.EventHandler; 4 | import javafx.geometry.HPos; 5 | import javafx.geometry.Insets; 6 | import javafx.geometry.Pos; 7 | import javafx.scene.Scene; 8 | import javafx.scene.control.*; 9 | import javafx.scene.layout.*; 10 | import javafx.scene.text.Font; 11 | import javafx.scene.text.FontWeight; 12 | import javafx.stage.Stage; 13 | import javafx.stage.Window; 14 | 15 | public class RegistrationFormApplication extends Application { 16 | 17 | @Override 18 | public void start(Stage primaryStage) throws Exception { 19 | primaryStage.setTitle("Registration Form JavaFX Application"); 20 | 21 | // Create the registration form grid pane 22 | GridPane gridPane = createRegistrationFormPane(); 23 | // Add UI controls to the registration form grid pane 24 | addUIControls(gridPane); 25 | // Create a scene with registration form grid pane as the root node 26 | Scene scene = new Scene(gridPane, 800, 500); 27 | // Set the scene in primary stage 28 | primaryStage.setScene(scene); 29 | 30 | primaryStage.show(); 31 | } 32 | 33 | 34 | private GridPane createRegistrationFormPane() { 35 | // Instantiate a new Grid Pane 36 | GridPane gridPane = new GridPane(); 37 | 38 | // Position the pane at the center of the screen, both vertically and horizontally 39 | gridPane.setAlignment(Pos.CENTER); 40 | 41 | // Set a padding of 20px on each side 42 | gridPane.setPadding(new Insets(40, 40, 40, 40)); 43 | 44 | // Set the horizontal gap between columns 45 | gridPane.setHgap(10); 46 | 47 | // Set the vertical gap between rows 48 | gridPane.setVgap(10); 49 | 50 | // Add Column Constraints 51 | 52 | // columnOneConstraints will be applied to all the nodes placed in column one. 53 | ColumnConstraints columnOneConstraints = new ColumnConstraints(100, 100, Double.MAX_VALUE); 54 | columnOneConstraints.setHalignment(HPos.RIGHT); 55 | 56 | // columnTwoConstraints will be applied to all the nodes placed in column two. 57 | ColumnConstraints columnTwoConstrains = new ColumnConstraints(200,200, Double.MAX_VALUE); 58 | columnTwoConstrains.setHgrow(Priority.ALWAYS); 59 | 60 | gridPane.getColumnConstraints().addAll(columnOneConstraints, columnTwoConstrains); 61 | 62 | return gridPane; 63 | } 64 | 65 | private void addUIControls(GridPane gridPane) { 66 | // Add Header 67 | Label headerLabel = new Label("Registration Form"); 68 | headerLabel.setFont(Font.font("Arial", FontWeight.BOLD, 24)); 69 | gridPane.add(headerLabel, 0,0,2,1); 70 | GridPane.setHalignment(headerLabel, HPos.CENTER); 71 | GridPane.setMargin(headerLabel, new Insets(20, 0,20,0)); 72 | 73 | // Add Name Label 74 | Label nameLabel = new Label("Full Name : "); 75 | gridPane.add(nameLabel, 0,1); 76 | 77 | // Add Name Text Field 78 | TextField nameField = new TextField(); 79 | nameField.setPrefHeight(40); 80 | gridPane.add(nameField, 1,1); 81 | 82 | 83 | // Add Email Label 84 | Label emailLabel = new Label("Email ID : "); 85 | gridPane.add(emailLabel, 0, 2); 86 | 87 | // Add Email Text Field 88 | TextField emailField = new TextField(); 89 | emailField.setPrefHeight(40); 90 | gridPane.add(emailField, 1, 2); 91 | 92 | // Add Password Label 93 | Label passwordLabel = new Label("Password : "); 94 | gridPane.add(passwordLabel, 0, 3); 95 | 96 | // Add Password Field 97 | PasswordField passwordField = new PasswordField(); 98 | passwordField.setPrefHeight(40); 99 | gridPane.add(passwordField, 1, 3); 100 | 101 | // Add Submit Button 102 | Button submitButton = new Button("Submit"); 103 | submitButton.setPrefHeight(40); 104 | submitButton.setDefaultButton(true); 105 | submitButton.setPrefWidth(100); 106 | gridPane.add(submitButton, 0, 4, 2, 1); 107 | GridPane.setHalignment(submitButton, HPos.CENTER); 108 | GridPane.setMargin(submitButton, new Insets(20, 0,20,0)); 109 | 110 | submitButton.setOnAction(new EventHandler() { 111 | @Override 112 | public void handle(ActionEvent event) { 113 | if(nameField.getText().isEmpty()) { 114 | showAlert(Alert.AlertType.ERROR, gridPane.getScene().getWindow(), "Form Error!", "Please enter your name"); 115 | return; 116 | } 117 | if(emailField.getText().isEmpty()) { 118 | showAlert(Alert.AlertType.ERROR, gridPane.getScene().getWindow(), "Form Error!", "Please enter your email id"); 119 | return; 120 | } 121 | if(passwordField.getText().isEmpty()) { 122 | showAlert(Alert.AlertType.ERROR, gridPane.getScene().getWindow(), "Form Error!", "Please enter a password"); 123 | return; 124 | } 125 | 126 | showAlert(Alert.AlertType.CONFIRMATION, gridPane.getScene().getWindow(), "Registration Successful!", "Welcome " + nameField.getText()); 127 | } 128 | }); 129 | } 130 | 131 | private void showAlert(Alert.AlertType alertType, Window owner, String title, String message) { 132 | Alert alert = new Alert(alertType); 133 | alert.setTitle(title); 134 | alert.setHeaderText(null); 135 | alert.setContentText(message); 136 | alert.initOwner(owner); 137 | alert.show(); 138 | } 139 | 140 | public static void main(String[] args) { 141 | launch(args); 142 | } 143 | } -------------------------------------------------------------------------------- /javafx-registration-form-fxml/Readme.md: -------------------------------------------------------------------------------- 1 | ## JavaFX Registration Form example using FXML 2 | 3 | The Project explains how to create a Registration form in JavaFX using FXML. 4 | Clone the Project, Import it into your favorite IDE and run `RegistrationFormApplication.java` for running the program. 5 | 6 | ## Tutorial 7 | 8 | Learn about the details of the application from the following tutorial - 9 | 10 | -------------------------------------------------------------------------------- /javafx-registration-form-fxml/src/javafx/example/AlertHelper.java: -------------------------------------------------------------------------------- 1 | package javafx.example; 2 | 3 | import javafx.scene.control.Alert; 4 | import javafx.stage.Window; 5 | 6 | /** 7 | * Created by rajeevkumarsingh on 02/05/17. 8 | */ 9 | public class AlertHelper { 10 | 11 | public static void showAlert(Alert.AlertType alertType, Window owner, String title, String message) { 12 | Alert alert = new Alert(alertType); 13 | alert.setTitle(title); 14 | alert.setHeaderText(null); 15 | alert.setContentText(message); 16 | alert.initOwner(owner); 17 | alert.show(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /javafx-registration-form-fxml/src/javafx/example/RegistrationFormApplication.java: -------------------------------------------------------------------------------- 1 | package javafx.example; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | public class RegistrationFormApplication extends Application { 10 | 11 | @Override 12 | public void start(Stage primaryStage) throws Exception{ 13 | Parent root = FXMLLoader.load(getClass().getResource("registration_form.fxml")); 14 | primaryStage.setTitle("Registration Form FXML Application"); 15 | primaryStage.setScene(new Scene(root, 800, 500)); 16 | primaryStage.show(); 17 | } 18 | 19 | 20 | public static void main(String[] args) { 21 | launch(args); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /javafx-registration-form-fxml/src/javafx/example/RegistrationFormController.java: -------------------------------------------------------------------------------- 1 | package javafx.example; 2 | 3 | import javafx.event.ActionEvent; 4 | import javafx.fxml.FXML; 5 | import javafx.scene.control.Alert; 6 | import javafx.scene.control.Button; 7 | import javafx.scene.control.PasswordField; 8 | import javafx.scene.control.TextField; 9 | import javafx.stage.Window; 10 | 11 | public class RegistrationFormController { 12 | @FXML 13 | private TextField nameField; 14 | 15 | @FXML 16 | private TextField emailField; 17 | 18 | @FXML 19 | private PasswordField passwordField; 20 | 21 | @FXML 22 | private Button submitButton; 23 | 24 | @FXML 25 | protected void handleSubmitButtonAction(ActionEvent event) { 26 | Window owner = submitButton.getScene().getWindow(); 27 | if(nameField.getText().isEmpty()) { 28 | AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Form Error!", 29 | "Please enter your name"); 30 | return; 31 | } 32 | if(emailField.getText().isEmpty()) { 33 | AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Form Error!", 34 | "Please enter your email id"); 35 | return; 36 | } 37 | if(passwordField.getText().isEmpty()) { 38 | AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Form Error!", 39 | "Please enter a password"); 40 | return; 41 | } 42 | 43 | AlertHelper.showAlert(Alert.AlertType.CONFIRMATION, owner, "Registration Successful!", 44 | "Welcome " + nameField.getText()); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /javafx-registration-form-fxml/src/javafx/example/registration_form.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | 44 | 45 | 46 | 47 | 50 | 51 | 53 | 54 | 55 | 56 | 57 | 60 | 61 | 63 | 64 | 65 | 66 | 76 | -------------------------------------------------------------------------------- /javafx-toolbar-example/Readme.md: -------------------------------------------------------------------------------- 1 | # JavaFX Toolbar Example App. 2 | -------------------------------------------------------------------------------- /javafx-toolbar-example/src/javafx/example/ToolbarDemoApp.java: -------------------------------------------------------------------------------- 1 | package javafx.example; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | public class ToolbarDemoApp extends Application { 10 | 11 | @Override 12 | public void start(Stage primaryStage) throws Exception{ 13 | Parent root = FXMLLoader.load(getClass().getResource("toolbar-demo.fxml")); 14 | primaryStage.setTitle("Toolbar Demo App"); 15 | primaryStage.setScene(new Scene(root, 800, 500)); 16 | primaryStage.show(); 17 | } 18 | 19 | 20 | public static void main(String[] args) { 21 | launch(args); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /javafx-toolbar-example/src/javafx/example/img/account-box-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callicoder/javafx-examples/d0a1a9cf7ac634508a47db5bfb70124947c36415/javafx-toolbar-example/src/javafx/example/img/account-box-outline.png -------------------------------------------------------------------------------- /javafx-toolbar-example/src/javafx/example/img/email-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callicoder/javafx-examples/d0a1a9cf7ac634508a47db5bfb70124947c36415/javafx-toolbar-example/src/javafx/example/img/email-outline.png -------------------------------------------------------------------------------- /javafx-toolbar-example/src/javafx/example/img/home-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callicoder/javafx-examples/d0a1a9cf7ac634508a47db5bfb70124947c36415/javafx-toolbar-example/src/javafx/example/img/home-outline.png -------------------------------------------------------------------------------- /javafx-toolbar-example/src/javafx/example/img/note-multiple-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callicoder/javafx-examples/d0a1a9cf7ac634508a47db5bfb70124947c36415/javafx-toolbar-example/src/javafx/example/img/note-multiple-outline.png -------------------------------------------------------------------------------- /javafx-toolbar-example/src/javafx/example/toolbar-demo.css: -------------------------------------------------------------------------------- 1 | .root { 2 | -fx-font-size: 14px; 3 | } 4 | 5 | .toolbar Button { 6 | -fx-background-color: transparent; 7 | -fx-content-display: top; 8 | -fx-pref-width: 90px; 9 | } 10 | 11 | .content { 12 | -fx-padding: 20px; 13 | -fx-vgap: 10px; 14 | } 15 | 16 | .heading { 17 | -fx-font-size: 18px; 18 | -fx-font-weight: 700; 19 | } 20 | 21 | .content Label { 22 | -fx-wrap-text: true; 23 | -fx-padding: 0 0 15px 0; 24 | } 25 | 26 | .footer { 27 | -fx-padding: 15px; 28 | -fx-alignment: center; 29 | -fx-border-width: 1; 30 | -fx-border-color: #E8E8E8 transparent transparent transparent; 31 | } -------------------------------------------------------------------------------- /javafx-toolbar-example/src/javafx/example/toolbar-demo.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 24 | 25 | 34 | 35 | 44 | 45 | 46 | 47 | 56 | 57 | 58 |
59 | 60 | 61 | 66 | 71 | 72 |
73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |
83 | --------------------------------------------------------------------------------