Generating plain Java code without FXML? #441
Replies: 3 comments 6 replies
-
Well, I have worked on the code to generate Controller Skeletons ( Full means, that all elements declared in the FXML will appear in the controller, regardless if there is an With having the feature placed in the What do you think? |
Beta Was this translation helpful? Give feedback.
-
public BattleFXGLPane(Stage stage, Map<Object, Object> parameters) {
super(stage, parameters);
var fxglPane = Game.embeddedLaunch(new Game(parameters));
Stop[] stops = new Stop[]{new Stop(0, Color.web("3372b5")), new Stop(0.5, Color.web("b3e7fa")), new Stop(0.9, Color.web("a4c9bd"))};
LinearGradient linearGradient = new LinearGradient(0, 0, 1, 1, true, CycleMethod.NO_CYCLE, stops);
fxglPane.setRenderFill(linearGradient);
fxglPane.prefWidthProperty().bind(widthProperty());
fxglPane.prefHeightProperty().bind(heightProperty());
fxglPane.renderWidthProperty().bind(widthProperty());
fxglPane.renderHeightProperty().bind(heightProperty());
getChildren().add(fxglPane);
} We write the code in the way of you suggested |
Beta Was this translation helpful? Give feedback.
-
Perhaps, as additional option for designing UI, we bring back JavaFXScript. It’s declarative and seems to be easier than XML. |
Beta Was this translation helpful? Give feedback.
-
Hi:
As discussed on Twitter: https://twitter.com/WhiteWoodCity/status/1480842744889507847
Is it possible for Scene Builder to generate plain Java code without FXML?
A lot of ppl are using JavaFX without FXML so would be nice to have FXML optional?
If so, this tool will be more useful and adopted
Based on our experiences, developers are usually more familiar with Java code rather than XML
Some of them are even hate XML because it is not IDE friendly
Hints and suggestions often collapse when using XML code but works very well for Java code
and some example projects have abandoned XML and using plain Java code to create MVC project
https://github.com/Pi4J/pi4j-template-javafx
So if we could have option to let the Scene Builder generate code with and without FXML
then developers could choose the development way they prefer
Thanks
Beta Was this translation helpful? Give feedback.
All reactions