25 lines
744 B
Java
25 lines
744 B
Java
package sample;
|
|
|
|
import javafx.application.Application;
|
|
import javafx.fxml.FXMLLoader;
|
|
import javafx.scene.Parent;
|
|
import javafx.scene.Scene;
|
|
import javafx.stage.Stage;
|
|
import javafx.stage.StageStyle;
|
|
|
|
public class Main extends Application {
|
|
|
|
@Override
|
|
public void start(Stage primaryStage) throws Exception{
|
|
primaryStage.initStyle(StageStyle.UNDECORATED);
|
|
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
|
|
primaryStage.setTitle("Hello World");
|
|
primaryStage.setScene(new Scene(root, 900, 500));
|
|
primaryStage.show();
|
|
root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close());
|
|
}
|
|
public static void main(String[] args) {
|
|
launch(args);
|
|
}
|
|
}
|