Got the drag thingto work

This commit is contained in:
Michael-Jouanneau 2016-10-29 21:52:54 +02:00
parent ba310840f7
commit 7b17f4eace
3 changed files with 5 additions and 4 deletions

View File

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

View File

@ -24,8 +24,9 @@ public class Main extends Application {
primaryStage.setScene(new Scene(root, 900, 500)); primaryStage.setScene(new Scene(root, 900, 500));
primaryStage.show(); primaryStage.show();
primaryStage.maximizedProperty().addListener((observable, oldValue, newValue) -> { primaryStage.maximizedProperty().addListener((observable, oldValue, newValue) -> {
if (newValue) if (newValue) {
primaryStage.setMaximized(false); primaryStage.setMaximized(false);
}
}); });
root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close()); root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close());

View File

@ -6,7 +6,7 @@
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500" prefWidth="900" xmlns="http://javafx.com/javafx/8.0.112-ea" xmlns:fx="http://javafx.com/fxml/1"> <Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500" prefWidth="900" xmlns="http://javafx.com/javafx/8.0.112-ea" xmlns:fx="http://javafx.com/fxml/1">
<children> <children>
<Button id="exit" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="732.0" layoutY="431.0" mnemonicParsing="false" stylesheets="@../assets/style/nav.css" text="Click if you like Pepe" /> <Rectangle id="rectangle" arcHeight="5.0" arcWidth="5.0" fill="white" height="50.0" stroke="white" strokeType="INSIDE" width="900.0" />
<Rectangle id="rectangle" arcHeight="5.0" arcWidth="5.0" fill="DODGERBLUE" height="50.0" stroke="BLACK" strokeType="INSIDE" width="900.0" /> <Button id="exit" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="862.0" layoutY="13.0" mnemonicParsing="false" stylesheets="@../assets/style/nav.css" text="X" />
</children> </children>
</Pane> </Pane>