Javafx introduction ppt

javafx presentation ppt and introducing javafx 8 programming pdf
OliviaCutts Profile Pic
OliviaCutts,France,Teacher
Published Date:01-08-2017
Your Website URL(Optional)
Comment
JavaFX Tutorial Tom Schindl tom.schindlbestsolution.at Anatomy of an FX-App import javafx.application.Application;
 
 Dervived from public class Main extends Application 
 base class 
 Override
 public void start(Stage primaryStage) (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0Anatomy of an FX-App import javafx.application.Application;
 
 Dervived from public class Main extends Application 
 base class 
 Override
 public void start(Stage primaryStage) BorderPane root = new BorderPane(); Root-Container (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0Anatomy of an FX-App import javafx.application.Application;
 
 Dervived from public class Main extends Application 
 base class 
 Override
 public void start(Stage primaryStage) BorderPane root = new BorderPane(); Root-Container Scene scene = new Scene(root,400,400); Scene with size (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0Anatomy of an FX-App import javafx.application.Application;
 
 Dervived from public class Main extends Application 
 base class 
 Override
 public void start(Stage primaryStage) BorderPane root = new BorderPane(); Root-Container Scene scene = new Scene(root,400,400); Scene with size primaryStage.setScene(scene); Display primaryStage.show(); (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0Anatomy of an FX-App import javafx.application.Application;
 
 Dervived from public class Main extends Application 
 base class 
 Override
 public void start(Stage primaryStage) BorderPane root = new BorderPane(); Root-Container Scene scene = new Scene(root,400,400); Scene with size primaryStage.setScene(scene); Display primaryStage.show(); public static void main(String args) launch(args); inherited method (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0Lab Hello World ‣Create a directory named „fx_tutorial“ on your filesystem e.g. C:\fx_tutorial, /Users/tom/fx_tutorial ‣Move eclipse-SDK-4.4.0-M6-arch.tar.gz/.zip to the directory and uncompress it there ‣Install JDK8u132 ‣Linux: extract it next to your eclipse-SDK ‣Launch Eclipse with JDK8 ‣Linux: Launch with ./eclipse -vm ../jdk8..../bin/java ‣Check that JDK8 is used via About Installation Details Configuration - search for „eclipse.vm“ (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0Lab Hello World ‣File New Project ... ‣Search for the JavaFX category ‣Select „JavaFX Project“ Next ‣Enter the following data: ‣Project name: MyFirstProject ‣Use an execution environment JRE: JavaSE-1.8 ‣Select: Finish (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0Lab Hello World ‣Create an instance of javafx.scene.control.Button which displays a text „Hello World“ ‣Handle a button click and print „Hello World“ Try to use the setOnAction API ‣ ‣Try to use the addEventHandler API ‣Display the button in the center of the BorderPane (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0Lab Hello World BorderPane root = new BorderPane(); Button b = new Button("Hello World"); b.setOnAction(new EventHandlerActionEvent() Override public void handle(ActionEvent event) System.out.println("Hello World via setOnAction"); ); b.addEventHandler(ActionEvent.ACTION, new EventHandlerActionEvent() Override public void handle(ActionEvent event) System.out.println("Hello World via addEventHandler"); ); root.setCenter(b); (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0FX-PropertiesFX-Properties ‣JavaFX Beans extends the JavaBean pattern ‣ getName/setName method nameProperty method ‣ ‣property-method returns ‣read/writable: javafx.beans.property.Property ‣readonly: javafx.beans.property.ReadOnlyProperty ‣Property-Objects are observable and can be bound together (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0FX-Properties public class JavaBean private String name; private PropertyChangeSupport support = new PropertyChangeSupport(this); public void setName(String name) support.firePropertyChange("name", this.name, this.name = name); public String getName() return this.name; (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0FX-Properties public class JavaFXBean private StringProperty name = new SimpleStringProperty(this,"name"); public void setName(String name) this.name.set(name); public String getName() return this.name.get(); public StringProperty nameProperty() return this.name; (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0FX-Properties ‣Properties can be bound ‣Unidirectional: Propertybind() Bidirectional: PropertybindBidirectional() ‣ ‣Unlink bindings: ‣Unidirectional: Propertyunbind() ‣Bidirectional: PropertyunbindBirectional() (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0Lab FXProperties ‣Create JavaFX Bean ‣Create UI with and bind propertiesLab FXProperties ‣Create a new JavaFX-Project ‣Create a JavaFX Bean ‣Name: MyBean ‣Properties: String-Property named „text“ ‣Add the following UI-Elements to the Main class ‣top: javafx.scene.control.TextField center: javafx.scene.text.Text ‣ ‣left: javafx.scene.control.Slider (hint: orientation) ‣right: javafx.scene.control.Slider (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0Lab FXProperties ‣Make the slider accept values in range min=1 & max=10 ‣Create an instance of MyBean ‣Bind: ‣bidirectional: MyBeantext to TextFieldtext ‣unidirectional: Texttext to MyBeantext ‣ ‣ TextscaleX to H-Slidervalue ‣ TextscaleY to V-Slidervalue (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0Lab FXProperties (for the fast one) ‣Make sure the sliders are only modifiable when the text field has a value entered (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0FX-Layouts

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.