Merge pull request #2 from GabrielTofvesson/master

Pull
This commit is contained in:
Taco Dev 2016-10-29 20:25:45 +02:00 committed by GitHub
commit 30d79d8643
3 changed files with 10 additions and 8 deletions

3
src/assets/nav.css Normal file
View File

@ -0,0 +1,3 @@
#exit{
-fx-background-color: rgba(255, 0, 255, 0.5);
}

View File

@ -5,19 +5,19 @@ import javafx.fxml.FXMLLoader;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class Main extends Application { 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);
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, 300, 275)); primaryStage.setScene(new Scene(root, 900, 500));
primaryStage.show(); primaryStage.show();
//Dankerino root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close());
} }
public static void main(String[] args) { public static void main(String[] args) {
launch(args); launch(args);
} }

View File

@ -1,11 +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?>
<?import javafx.scene.shape.Circle?>
<?import javafx.scene.shape.Rectangle?>
<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="620.0" xmlns="http://javafx.com/javafx/8.0.102" xmlns:fx="http://javafx.com/fxml/1">
<children> <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> </children>
</Pane> </Pane>