Adds style and crappy exit button
This commit is contained in:
parent
fc813e1a65
commit
2039f2b9ac
3
src/assets/nav.css
Normal file
3
src/assets/nav.css
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#exit{
|
||||||
|
-fx-background-color: rgba(255, 0, 255, 0.5);
|
||||||
|
}
|
@ -16,6 +16,8 @@ public class Main extends Application {
|
|||||||
primaryStage.setTitle("Hello World");
|
primaryStage.setTitle("Hello World");
|
||||||
primaryStage.setScene(new Scene(root, 400, 400));
|
primaryStage.setScene(new Scene(root, 400, 400));
|
||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
|
|
||||||
|
root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close()); // Close program if button is clicked
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
<?import javafx.scene.layout.Pane?>
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
|
||||||
|
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.102" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.102" xmlns:fx="http://javafx.com/fxml/1" />
|
<children>
|
||||||
|
<Button id="exit" fx:id="pepe" alignment="TOP_RIGHT" contentDisplay="RIGHT" mnemonicParsing="false" stylesheets="@../assets/nav.css" text="Click if you like Pepe" />
|
||||||
|
</children>
|
||||||
|
</Pane>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user