Added no Fullscreen code
This commit is contained in:
parent
2039f2b9ac
commit
d7340c255d
@ -11,12 +11,15 @@ public class Main extends Application {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage primaryStage) throws Exception{
|
public void start(Stage primaryStage) throws Exception{
|
||||||
primaryStage.initStyle(StageStyle.UNDECORATED);
|
primaryStage.initStyle(StageStyle.UNIFIED);
|
||||||
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
|
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
|
||||||
primaryStage.setTitle("Hello World");
|
primaryStage.setTitle("Hello World");
|
||||||
primaryStage.setScene(new Scene(root, 400, 400));
|
primaryStage.setScene(new Scene(root, 900, 500));
|
||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
|
primaryStage.maximizedProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
|
if (newValue)
|
||||||
|
primaryStage.setMaximized(false);
|
||||||
|
});
|
||||||
root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close()); // Close program if button is clicked
|
root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close()); // Close program if button is clicked
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user