Après des heures pour comprendre comment faire ce que je voulais et ensuite le faire voilà que SceneBuilder m'affiche bien ce que j'ai créé comme fichier fxml avec lui-même mais au lancement de me même fichier FXML mes boutons ne s'affichent pas....
Mon Scenic View ne semble evidemment ne plus analyser les details de la JVM de mon application non plus.
Il faut vraiment que Oracle parie sur la pédagogie de la mise en oeuvre de JavaFX parce que ca reste quand même un parcours du combattant pour le moment.
Voici l'instruction de chargement de mon fichier FXML :
Parent root = FXMLLoader.load(getClass().getResource("Root3.fxml"));
ainsi que mon fichier fxml :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| <?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.net.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?>
<BorderPane prefHeight="922.0" prefWidth="1171.0" xmlns:fx="http://javafx.com/fxml">
<bottom>
<HBox prefHeight="100.0" prefWidth="200.0" style="-fx-background-color:grey" />
</bottom>
<center>
<Pane prefHeight="250.0" prefWidth="250.0" style="-fx-background-color:red" />
</center>
<left>
<FlowPane prefHeight="200.0" prefWidth="100.0" style="-fx-background-color:yellow" />
</left>
<right>
<Pane prefHeight="200.0" prefWidth="100.0" style="-fx-background-color:green">
<stylesheets>
<URL value="@../sceneStyleSheets.css" />
</stylesheets>
</Pane>
</right>
<top>
<Pane prefHeight="200.0" prefWidth="200.0">
<children>
<Button alignment="CENTER" contentDisplay="TOP" graphicTextGap="0.0" layoutX="1149.0" layoutY="7.0" minHeight="13.0" minWidth="16.0" mnemonicParsing="false" prefHeight="15.0" prefWidth="15.0" style="-fx-padding : 0; -fx-background-color : transparent; -fx-border-color:grey; -fx-border-width:2; -fx-background-radius:30; -fx-border-radius:30; ">
<graphic>
<ImageView fitHeight="7.0" fitWidth="7.0" pickOnBounds="true">
<image>
<Image url="@../resources/croixGris.png" preserveRatio="false" smooth="false" />
</image>
</ImageView>
</graphic>
</Button>
<Button alignment="CENTER" contentDisplay="TOP" graphicTextGap="0.0" layoutX="1149.0" layoutY="29.0" minHeight="13.0" minWidth="16.0" mnemonicParsing="false" prefHeight="15.0" prefWidth="15.0" style="-fx-padding : 0;
-fx-background-color : transparent;
-fx-border-color:grey;
-fx-border-width:2;
-fx-background-radius:30;
-fx-border-radius:30;
">
<graphic>
<ImageView fitHeight="7.0" fitWidth="7.0" pickOnBounds="true">
<image>
<Image url="@../resources/moinsGris.png" preserveRatio="false" smooth="false" />
</image>
</ImageView>
</graphic>
</Button>
<Button alignment="CENTER" contentDisplay="TOP" graphicTextGap="0.0" layoutX="1149.0" layoutY="52.0" minHeight="13.0" minWidth="16.0" mnemonicParsing="false" prefHeight="15.0" prefWidth="15.0" style="-fx-padding : 0;
-fx-background-color : transparent;
-fx-border-color:grey;
-fx-border-width:2;
-fx-background-radius:30;
-fx-border-radius:30;
">
<graphic>
<ImageView fitHeight="7.0" fitWidth="7.0" pickOnBounds="true">
<image>
<Image url="@../resources/plusGris.png" preserveRatio="false" smooth="false" />
</image>
</ImageView>
</graphic>
</Button>
</children>
</Pane>
</top>
</BorderPane> |
A l'execution aucun bouton n'apparait mais le reste oui.
Aurais-tu une idée par hasard ?
Partager