-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloworld1.java
More file actions
31 lines (26 loc) · 914 Bytes
/
Copy pathHelloworld1.java
File metadata and controls
31 lines (26 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package application;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Helloworld1 extends Application {
@Override
public void start(Stage primaryStage) {
// Create a layout for the scene
StackPane root = new StackPane();
// Add a label to the layout
root.getChildren().add(new Label("Hello, JavaFX!"));
// Create a scene with the layout
Scene scene = new Scene(root, 300, 200);
// Set the title of the stage
primaryStage.setTitle("Hello JavaFX!");
// Add the scene to the stage
primaryStage.setScene(scene);
// Show the stage
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}