際際滷

際際滷Share a Scribd company logo
JavaFX for
interface
TEACHER NAME | Oxana Dudnik
Work with JAVAFX
舒亞仍礌亠仄 仆舒 舒亶 www.oracle.com 亳 从舒舒亠仄 Oracle速 JDK 7  仗仂亟亟亠亢从仂亶
JavaFX 2.2.n, 舒 仗仂仂仄 仄仂亢仆仂 于仂仗仂仍亰仂于舒 仗仂仂弍亳亠仄 jfxpub-get_started
http://docs.oracle.com/javafx/2/get_started/jfxpub-get_started.htm
, 仂弍 仂亰亟舒 仗仂仂亠 仗亳仍仂亢亠仆亳亠, 亟亠仄仂仆亳ム亠亠 舒弍仂 仂
仍仂礆亳, 舒弍仍亳舒仄亳 亳仍亠亶 亳 于亳亰舒仍仆仄亳 亠从舒仄亳. 亠 舒仄
仗亠亟仍舒亞舒亠 亳仗仂仍亰仂于舒 JavaFX Scene Builder 亟仍 舒亰舒弍仂从亳
仗仂仍亰仂于舒亠仍从仂亞仂 亳仆亠亠亶舒 弍亠亰 从仂亟亳仆亞舒
弌 于仂亰仄仂亢仆仂礆亳 JavaFX 仄仂亢仆仂 仂亰仆舒从仂仄亳 仆舒 舒仆亳亠 仗仍舒仂仄
http://docs.oracle.com/javase/8/javase-clienttechnologies.htm
 API 亠 仆舒弍仂 从仍舒仂于 亟仍 亳仂于舒仆亳 仗亳仄亳亳于仂于, 亞舒亳从仂于, 仆舒弍仂
从仂仄仗仂仆亠仆仂于 GUI  仂弍于亠仆仆仄 仂仂仄仍亠仆亳亠仄. 舒从仂仆亠-仂 仗仂磦亳仍
从仂仄仗仂仆亠仆 于亠弍-弍舒亰亠舒 亳 亠从仂于亶 亠亟舒从仂  于仂亰仄仂亢仆仂
仂仄舒亳仂于舒仆亳.
舒 舒仆亳亠
http://www.oracle.com/technetwork/java/javafx/overview/index.html 仄仂亢仆仂
亰舒仗亳 亟亠仄仂-仗亳仍仂亢亠仆亳亠 Ensemble (仂 舒仆舒仍仂亞 Flex Component
Explorer).
Hello, World! With JavaFx
package hellojavafx;
import javafx.application.*;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.stage.*;
public class HelloJavaFX extends Application {
public static void main(String[] args) {
Application.launch(args); }
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Hello World");
Group root = new Group();
Scene scene = new Scene(root, 300, 250);
Button btn = new Button();
btn.setLayoutX(100); btn.setLayoutY(80); btn.setText("Hello World");
btn.setOnAction(new EventHandler<ActionEvent>()
{
public void handle(ActionEvent event) { System.out.println("Hello World"); } });
root.getChildren().add(btn);
primaryStage.setScene(scene);
Java fx for interface
Usage JavaFXtemplates-
library
Library import as
import javafx.templates.footer.Footer; //仂亰亟舒亠 亠
import javafx.templates.initScreen.Initializer;//亰舒亞亢舒亠 JavaFx
import javafx.templates.header.Header;//仂亰亟舒亠 亠亟亠
import javafx.templates.lang.LanguageLocal;// 亳仆亳亳舒仍亳亰亳亠 磶从
仗仂 仄仂仍舒仆亳
import javafx.templates.messages.ErrorMonitor;//仂亰亟舒亠 仂从仆仂
仂仂弍亠仆亳亶 仂弍 仂亳弍从亠
舒仗亳仄亠:
Usage JavaFXtemplates-
library
Header header = javafx.templates.header.Header.getInstance(
"/resources/images/header/internet.jpg",
"/resources/images/header/green.png",
heightHeader,widthHeader
);
header.getNode().setLayoutX(0);
header.getNode().setLayoutY(0);
Usage JavaFXtemplates-
library
Footer footer = Footer.getInstance(false, false, true, 145,width);
footer.getNode().setLayoutX(0);
footer.getNode().setLayoutY(height - Footer.heightFooter);
root.getChildren().addAll(
header.getNode(),
container,
footer.getNode()
);
Usage JavaFXtemplates-
library
Usage JavaFXtemplates-
library
仍 仗仂亟从仍ム亠仆亳 弍亳弍仍亳仂亠从亳 仆亢仆仂 亳仄亠 JavaFxApp.jar
亞仂 仄仂亢仆仂 从舒舒  舒亶舒
http://亳亠仍从亳亶.舒亶/Dudnik-Oxana-Antonovna

More Related Content

Java fx for interface

  • 2. Work with JAVAFX 舒亞仍礌亠仄 仆舒 舒亶 www.oracle.com 亳 从舒舒亠仄 Oracle速 JDK 7 仗仂亟亟亠亢从仂亶 JavaFX 2.2.n, 舒 仗仂仂仄 仄仂亢仆仂 于仂仗仂仍亰仂于舒 仗仂仂弍亳亠仄 jfxpub-get_started http://docs.oracle.com/javafx/2/get_started/jfxpub-get_started.htm , 仂弍 仂亰亟舒 仗仂仂亠 仗亳仍仂亢亠仆亳亠, 亟亠仄仂仆亳ム亠亠 舒弍仂 仂 仍仂礆亳, 舒弍仍亳舒仄亳 亳仍亠亶 亳 于亳亰舒仍仆仄亳 亠从舒仄亳. 亠 舒仄 仗亠亟仍舒亞舒亠 亳仗仂仍亰仂于舒 JavaFX Scene Builder 亟仍 舒亰舒弍仂从亳 仗仂仍亰仂于舒亠仍从仂亞仂 亳仆亠亠亶舒 弍亠亰 从仂亟亳仆亞舒
  • 3. 弌 于仂亰仄仂亢仆仂礆亳 JavaFX 仄仂亢仆仂 仂亰仆舒从仂仄亳 仆舒 舒仆亳亠 仗仍舒仂仄 http://docs.oracle.com/javase/8/javase-clienttechnologies.htm API 亠 仆舒弍仂 从仍舒仂于 亟仍 亳仂于舒仆亳 仗亳仄亳亳于仂于, 亞舒亳从仂于, 仆舒弍仂 从仂仄仗仂仆亠仆仂于 GUI 仂弍于亠仆仆仄 仂仂仄仍亠仆亳亠仄. 舒从仂仆亠-仂 仗仂磦亳仍 从仂仄仗仂仆亠仆 于亠弍-弍舒亰亠舒 亳 亠从仂于亶 亠亟舒从仂 于仂亰仄仂亢仆仂 仂仄舒亳仂于舒仆亳. 舒 舒仆亳亠 http://www.oracle.com/technetwork/java/javafx/overview/index.html 仄仂亢仆仂 亰舒仗亳 亟亠仄仂-仗亳仍仂亢亠仆亳亠 Ensemble (仂 舒仆舒仍仂亞 Flex Component Explorer).
  • 4. Hello, World! With JavaFx package hellojavafx; import javafx.application.*; import javafx.event.*; import javafx.scene.*; import javafx.scene.control.*; import javafx.stage.*; public class HelloJavaFX extends Application { public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage primaryStage) { primaryStage.setTitle("Hello World"); Group root = new Group(); Scene scene = new Scene(root, 300, 250); Button btn = new Button(); btn.setLayoutX(100); btn.setLayoutY(80); btn.setText("Hello World"); btn.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { System.out.println("Hello World"); } }); root.getChildren().add(btn); primaryStage.setScene(scene);
  • 6. Usage JavaFXtemplates- library Library import as import javafx.templates.footer.Footer; //仂亰亟舒亠 亠 import javafx.templates.initScreen.Initializer;//亰舒亞亢舒亠 JavaFx import javafx.templates.header.Header;//仂亰亟舒亠 亠亟亠 import javafx.templates.lang.LanguageLocal;// 亳仆亳亳舒仍亳亰亳亠 磶从 仗仂 仄仂仍舒仆亳 import javafx.templates.messages.ErrorMonitor;//仂亰亟舒亠 仂从仆仂 仂仂弍亠仆亳亶 仂弍 仂亳弍从亠 舒仗亳仄亠:
  • 7. Usage JavaFXtemplates- library Header header = javafx.templates.header.Header.getInstance( "/resources/images/header/internet.jpg", "/resources/images/header/green.png", heightHeader,widthHeader ); header.getNode().setLayoutX(0); header.getNode().setLayoutY(0);
  • 8. Usage JavaFXtemplates- library Footer footer = Footer.getInstance(false, false, true, 145,width); footer.getNode().setLayoutX(0); footer.getNode().setLayoutY(height - Footer.heightFooter); root.getChildren().addAll( header.getNode(), container, footer.getNode() );
  • 10. Usage JavaFXtemplates- library 仍 仗仂亟从仍ム亠仆亳 弍亳弍仍亳仂亠从亳 仆亢仆仂 亳仄亠 JavaFxApp.jar 亞仂 仄仂亢仆仂 从舒舒 舒亶舒 http://亳亠仍从亳亶.舒亶/Dudnik-Oxana-Antonovna