Simple JavaFx Program Hello World
Reqirement :
NetBeans Version at least 7.1 or PreRelease.
Code :
package javafxtest;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;
import javafx.stage.Stage;
public class test extends Application {
@Override
public void start(Stage stage) throws Exception {
TextFlow textFlow = new TextFlow();
Font font = new Font("Arial", 48);
Text text1 = new Text("Hello World");
text1.setFill(Color.RED);
text1.setFont(font);
textFlow.getChildren().add(text1);
Group group = new Group(textFlow);
Scene scene = new Scene(group, 650, 150, Color.WHITE);
stage.setTitle("Hello Bidi Text");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Download : test.java
Output:
Reqirement :
NetBeans Version at least 7.1 or PreRelease.
Code :
package javafxtest;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;
import javafx.stage.Stage;
public class test extends Application {
@Override
public void start(Stage stage) throws Exception {
TextFlow textFlow = new TextFlow();
Font font = new Font("Arial", 48);
Text text1 = new Text("Hello World");
text1.setFill(Color.RED);
text1.setFont(font);
textFlow.getChildren().add(text1);
Group group = new Group(textFlow);
Scene scene = new Scene(group, 650, 150, Color.WHITE);
stage.setTitle("Hello Bidi Text");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Download : test.java
Output:
JavaFx HelloWorld
Reviewed by Unknown
on
5:11 pm
Rating:
No comments: