Upload files to "OOP/Java/Lab/Week13"
This commit is contained in:
parent
8fbdd81a2b
commit
343e8e0aff
29
OOP/Java/Lab/Week13/FirstFXApp.java
Normal file
29
OOP/Java/Lab/Week13/FirstFXApp.java
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import javafx.application.Application;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.scene.layout.FlowPane;
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
|
public class FirstFXApp extends Application {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void start(Stage primaryStage) {
|
||||||
|
Label welcomeLabel = new Label("Welcome to JavaFX programming");
|
||||||
|
welcomeLabel.setTextFill(Color.MAGENTA);
|
||||||
|
|
||||||
|
FlowPane flowPane = new FlowPane();
|
||||||
|
flowPane.setHgap(15);
|
||||||
|
flowPane.setVgap(15);
|
||||||
|
flowPane.getChildren().add(welcomeLabel);
|
||||||
|
|
||||||
|
Scene scene = new Scene(flowPane, 500, 200);
|
||||||
|
primaryStage.setTitle("This is the first JavaFX Application");
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
primaryStage.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
launch(args);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user