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
6
votes
2 answers

JavaFX - Reusable FXML component

I am building a GUI with Scene Builder, and the majority of my scenes have one element in common (an iOS type home button at the bottom). I was wondering if it was possible to define this component in a separate fxml file. From the research I…
Loïs Talagrand
  • 810
  • 2
  • 13
  • 32
6
votes
2 answers

Wrapping Label text in a VBox using FXML

I'm writing a JavaFX application and I'd like to create a screen that contains 2 long pieces of text. I don't know what the text is ahead of time, it will be filled in by some code at run time. To do this I thought I'd make a VBox with 2 Labels. I…
Sander Smith
  • 1,371
  • 4
  • 20
  • 30
6
votes
1 answer

Grouping together JavaFX FXML Objects

Exceptionally descriptive and informative answers will get a bounty worth 50 reputation from me. I am developing an application in JavaFX, and for views, I use FXML.
codez
  • 1,440
  • 2
  • 19
  • 34
6
votes
1 answer

URL Path for an ImageView using Javafx and Maven

I am designing a JavaFX program, using zenjava basic archetype. Everything works just find, except when I want to add and Image using an ImageView widget. I have created a new folder under src/main/resources called images where I store the image I…
Asaak
  • 477
  • 1
  • 6
  • 15
6
votes
2 answers

Scala name mangling of private fields and JavaFX FXML injection

The following example and explanations are quite long, so here is the gist of my question: how to deal with scalac's name-mangling of private fields when using a framework which insists on performing field injection (on fields which really should…
Cyäegha
  • 4,191
  • 2
  • 20
  • 36
6
votes
1 answer

JavaFx, Problems with @FXML

I'm new in java, so I have to ask you for help :P. I'm creating very simple program, but I stucked on verifying password and login textField. I'm wondering what is wrong with that code, can you help me? Controller package sample; import…
Mich44
  • 95
  • 1
  • 1
  • 7
6
votes
2 answers

How to create tabs dynamically in JavaFX using FXML?

How do you create a new tab using JavaFX/FXML? I've created a tabpane in my FXML but I want to click a button that causes a new tab to come up. Here is my FXML:
user3505901
  • 408
  • 1
  • 6
  • 19
6
votes
1 answer

JavaFX8 list bindings similar to xaml

I am unable to bind in fxml a collection to a customized template. Here the code how I would do it in xaml:
6
votes
1 answer

Add bullet point to JavaFX label

Is it possible to add a bullet point to the start of a JavaFX label? Here is basic FXML for a label
Gillardo
  • 9,518
  • 18
  • 73
  • 141
6
votes
2 answers

No injectable field found in FXML Controller class

It's about JavaFX. When i want to inject fx:id in Scene Builder, i get this warning: No injectable field found in FXML Controller class for the id 'something'. I wanted to ignore it, and created a function, but it didn't work either. I created…
rzaaeeff
  • 850
  • 1
  • 10
  • 18
6
votes
5 answers

FXMLLoader.load() never exits (JavaFX 8)

I am attempting to load the main screen for my application, which in fact never actually runs and shows a screen. Upon further investigation (running it through the NetBeans debugger), I found that my code never executes after FXMLLoader.load(url);…
erzr2
  • 155
  • 3
  • 12
6
votes
1 answer

where is the: FXML Specification?

I am looking for the Oracle FXML specification, reference manual or just user guide. I've come across quite a few books and blogs using the literal name, and nothing on Google, Stackoverflow, Wikipdeia or the JavaFX pages to link with such a…
will
  • 4,799
  • 8
  • 54
  • 90
6
votes
1 answer

JavaFX: keep all components in center even when resizing a window

I want all my components (TextFields, labels, etc.) stay in the center with fixed size. I am making it in scene builder and it works when I see the preview, but when I launch it, components don't stay in the center when I resize it. Please see the…
Cortez Nix
  • 121
  • 1
  • 6
6
votes
2 answers

how set splitpane divider width in javafx 2

I have SplitPane in my application. This is SplitPane have divider with default width. How can i set the width of SplitPane Divider @FXML private SplitPane splitPane; // splitPane here get Divider and set New Width
java baba
  • 2,199
  • 13
  • 33
  • 45
6
votes
1 answer

JavaFX 8 DatePicker features

I just start using the new JavaFX 8 control DatePicker. In DatePicker User Experience Documentation, it is stated that it has couple of cool features that I would like to have in my GUI application: I want to change the format from mm/dd/yyyy to…
Eng.Fouad
  • 115,165
  • 71
  • 313
  • 417