Copied the teacher
This commit is contained in:
parent
b51bc8d120
commit
df0fabee6f
2 changed files with 6 additions and 10 deletions
|
@ -3,26 +3,22 @@ package com.example;
|
|||
import javafx.application.Application;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
|
||||
/**
|
||||
* JavaFX App
|
||||
*/
|
||||
public class App extends Application {
|
||||
|
||||
@Override
|
||||
public void start(Stage stage) {
|
||||
var javaVersion = SystemInfo.javaVersion();
|
||||
var javafxVersion = SystemInfo.javafxVersion();
|
||||
Label label = new Label("Hello World");
|
||||
label.setFont(new Font(40));
|
||||
|
||||
Scene scene = new Scene(label);
|
||||
|
||||
var label = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
|
||||
var scene = new Scene(new StackPane(label), 640, 480);
|
||||
stage.setScene(scene);
|
||||
stage.setTitle("Welcome to JavaFX!");
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch();
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue