Questions tagged [fxml]

a scriptable XML-based language that provides the structure for building a JavaFX user interface separate from the application logic of your code.

FXML was introduced with the release of JavaFX 2.0 in 2011 by Oracle. It's rich XML-based language to declare JavaFX UI in structured format.

Using FXML allows to separate logic from presentation which is very welcome in modern MVC world.

In addition to straightforward UI declaration FXML allows:

  • using Controller for seamless mapping of the XML entities to the JavaFX objects.
  • referring property files (e.g. for i18n support)
  • introducing variables
  • setup complex object by referring static method calls
  • work with collections
  • even using JavaScript or other scripting languages

A good start to learn more about the format would be the Oracle article JavaFX: Mastering FXML.

3561 questions
1
vote
0 answers

Javafx starting but not running

My javafx application starts up but its not running after build with e(fx)clipse. Straight from eclipse it works just fine. Running it with java -jar Djavafx.verbose=true does not give any errors. Project can be found on…
1
vote
1 answer

How to make custom buttons in fxml with javafx script

I want to know how do you add buttons to a panel in fxml with javafx script because my program doesn't have a static amount of buttons. Is it even posible or has someone another idea? Thank you Fire-Phoenix
1
vote
0 answers

Use extended LineChart from FXML

I want to use LineChartEx (an extended class) directly in place of LineChart within FXML. I've extended LineChart to add some extra methods that I need from the forms controller, but this question is applicable to extending any JavaFX…
Daniel Walton
  • 218
  • 1
  • 4
  • 17
1
vote
1 answer

JavaFX: Remove the scene loaded in Center of BorderPane

I have a JavaFX2.2 application which has a BorderPane on the main screen. On the top Pane I have two buttons 'Button A' and 'Button B' to dynamically load scenes 'Scene A' and 'Scene B' in the center of the BorderPane respectively. 'Scene A' has two…
A J Qarshi
  • 2,772
  • 6
  • 37
  • 53
1
vote
1 answer

Java FX Getting a custom control working using multiple FXML files

I am trying to work with custom controls in JavaFX and multiple FXML files. I create a custom control: public class PetListGUIManager extends BorderPane { @FXML ListView petList; private PetManager pm; public…
1
vote
2 answers

Run JavaFX Controller in a separate thread

Hi i need to upgrade GUI from SWT to JavaFX and have problem straight at the beginning. The main class inherits from Thread and is being run from a certain method (interface implementation): @Override public void mStart() { …
wieczors
  • 341
  • 1
  • 5
  • 18
1
vote
1 answer

Buttons in GridPane with prefWidth="Infinity" break JavaFX

I am just starting with JavaFX so please excuse if this is a dumb mistake to make. I have a GridPane which I want to use to have two buttons next to eachother stretch over the whole width of the window. So I created a GridPane with one row and two…
mgttlinger
  • 1,435
  • 2
  • 21
  • 35
1
vote
1 answer

How to properly bind javafx label (from fxml) to SimpleStringProperty

I've got Controller that handles actions from UI created by a Scene Builder. Now when i'm trying to bind a label from this UI to a SimpleTextProperty inside a Controllers constructor i'm getting nullpointer exception. Apparently productInfoLabel is…
wieczors
  • 341
  • 1
  • 5
  • 18
1
vote
0 answers

How to lead FXML file at run-time?

I have an Accordion pane that is dynamically populated with TitledPanes. Each TitlePane needs to hold a child AnchorPane that will display relevant information for that object. The child AnchorPane is held in a separate FXML file and needs to be…
spacitron
  • 2,095
  • 7
  • 30
  • 39
1
vote
2 answers

What are the pros and cons FXML?

What are the pros and cons of using FXMLs or not using FXMLs for developing JavaFX applications? For developing enterprise JavaFX application which approach should one follow?
Angom
  • 721
  • 1
  • 11
  • 27
1
vote
1 answer

Java FXML :How to TableCell Edit Column Then reflect to second Column

Price: 150; Quantity : 4; total Price :600; Then I am Quantity Change then Reflect to the Total Price. How To Solve It?
1
vote
3 answers

Why am I getting a stackoverflow when loading my fxml?

I've adjusted my controller constructor and fxml so that all setup of the fxml to the controller is in the fxml except for the FXML construction and the fxml loading. Here is my controller: public class MainOverviewTab extends Tab { @FXML private…
j will
  • 3,747
  • 11
  • 41
  • 64
1
vote
1 answer

Netbeans says class does not exist in FXML file for observablearrayList but it does

I have this FXML file generated by Netbeans (but I have modified the TableColumn bit):
user3063257
  • 129
  • 1
  • 4
  • 12
1
vote
1 answer

java.lang.NullPointerException for Multi Screens JavaFX/FXML

So, I'm doing a JavaFX multiview GUI application. Below is the code so that you can refer to it, don't read through it to find an error yet, I'll explain the problem underneath first ;) I have a main - which starts the application public class…
1
vote
1 answer

JavaFX & FXML: assign ChangeListener to observable property

According to the JavaFX tutorial it should be possible to register event handlers to observable properties in FXML: Any class that defines a setOnEvent() method can be assigned an event handler in markup, as can any observable property (via an…
Puce
  • 37,247
  • 13
  • 80
  • 152