Quick question, when creating javafx GUIs, do you guys prefer fxml or raw java code?
I only started learning it, and I seem to favor just the java code. Though I know using fxml can segregate software functionality and software gui.
Maybe the only reason l don't like fxml is because I'm unfamiliar with it, I have never dealt with xml before. But I heard before that it has something to do with web development. I really need to google it lol.
What do you guys think?
P.S code below is my first javaFX app. So no hate :)
I only started learning it, and I seem to favor just the java code. Though I know using fxml can segregate software functionality and software gui.
Maybe the only reason l don't like fxml is because I'm unfamiliar with it, I have never dealt with xml before. But I heard before that it has something to do with web development. I really need to google it lol.
What do you guys think?
P.S code below is my first javaFX app. So no hate :)
PHP Code
<?php
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.stage.Stage;
public class MainProg extends Application {
private static int x = 0;
public static void main(String[] args) {
launch(args);
}
public void start(Stage mainStage){
mainStage.setTitle("Software: Add 1");
FlowPane myLayout = new FlowPane();
Label myLabel = new Label(" " + x);
Button myButton = new Button("Add 1");
myButton.setOnAction(e -> {
x++;
myLabel.setText(" " + x);
});
myLayout.getChildren().addAll(myButton, myLabel);
Scene myScene = new Scene(myLayout, 150, 75);
mainStage.setScene(myScene);
mainStage.show();
}
}


![[Image: T4BXHDP.png]](https://i.imgur.com/T4BXHDP.png)
