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
1 answer

JavaFX transition scene from Controller

I am very new to JavaFX (and java in general) and I have been trying to transition between scenes from an FXML controller. I have tried to look up multiple solutions online however, none of them seem to work. My main java code: package main; import…
1
vote
1 answer

Looking for a guide using FXML with Java 7

I need to target Java 7 and would like to use JavaFX and FXML on that project. We have some working code for Java 8 and it would save an immense amount of time if we can retro-fit those modules to Java 7. I'm posting because I'm getting compile…
will
  • 4,799
  • 8
  • 54
  • 90
1
vote
1 answer

Busy popup in JavaFX when FXML parsing is too slow

FXML performance is an issue with JavaFX, if you have complex screens and have divided them into small components (for maintainability / reuse) that use FXML, then it can get really slow. As FXML parsing is made in UI Thread (not sure of this, still…
zenbeni
  • 7,019
  • 3
  • 29
  • 60
1
vote
1 answer

Javafx - Fit ScrollPane Size to content

I've got a really annoying problem. I want my ScrollPane to fit my content, but the properties fitToHeight and fitToWidth aren't working.
pichlbaer
  • 923
  • 1
  • 10
  • 18
1
vote
1 answer

Moving a user's selection from one ListView to another ListView Java FX

The code below contains two Listview's, the user is to select a name from the first list view and when the add button is hit, it will move the content to an array which the 2nd List view is supposed to update and display as changes are made. I…
1
vote
1 answer

Table with buttons using FXML (JavaFX)

I am learning JavaFX and FXML. I am using the tutorials available on the Oracle website. In particular, I am developing an application using the Oracle example of an FXML Address Book as a starting point…
Discipulus
  • 245
  • 1
  • 3
  • 13
1
vote
1 answer

Working with JFXtras-Agenda, how to add it to the fxml-File

How can I add the JFXtras Agenda to my fxml-File, since I usually work with the Scenebuilder, i´m not very experienced with fxml Coding. It would be great if someone can show some of his/her Code.
user3915746
1
vote
1 answer

JavaFX and css misunderstanding

In my fxml I have url for css (this fxml created via SceneBuilder) ... and test.css contains .root{ ... } If I do preview in SceneBuider…
Joel
  • 473
  • 2
  • 7
  • 22
1
vote
1 answer

JavaFX Scene Builder, multiple ImageViews with the same image

I have placed a few image views to the scene, all pointing to the same image with different viewports. generated fxml:
Steel Talon
  • 81
  • 1
  • 3
1
vote
1 answer

javafx 8 fxml negation

Using FXML with JavaFx 8. I have few ToggleButtons in toggleGroup, defined as: I want to disable OK button, when no operater is selected. Actually, I want to negate the disable expression in ok button:
esmin
  • 491
  • 7
  • 14
1
vote
2 answers

JavaFX: load resource from other package - NetBeans

I know there have already been some questions about relative paths, but I Keep failing to get JavaFX FXML loader to load a resource from a package other than itself. The loading class is located in the package gui.controllers and the fxml file…
Jaap
  • 49
  • 4
1
vote
1 answer

JavaFX I can´t fill tableview by observableList

i have problem with filling Tableview. When I run this code, my tableview has same number of records like Observablelist but nothing is visible. Any idea? A donť understans some like cellvalueProperty. Is this usable for my example? Thanks. package…
Edák Edák
  • 33
  • 3
  • 9
1
vote
1 answer

FXML layout not loaded when run jar outside Eclipse

I try to load my fxml layout file as follows: FXMLLoader loader = new FXMLLoader(); loader.setLocation(getClass().getResource("view/MainLayout.fxml")); AnchorPane personOverview = (AnchorPane) loader.load(); When I run application in Eclipse all…
Wolf6969
  • 147
  • 1
  • 3
  • 10
1
vote
1 answer

JavaFX8: Application in fullscreen mode doesn't show focus on elements

I have the following problem: I would like to see which textfield or button is focused when I enter my multiscreen application in fullscreen mode. But for some reason, it is not showing the focus "glow" around for example a textfield. This is not a…
bashoogzaad
  • 4,611
  • 8
  • 40
  • 65
1
vote
1 answer

JavaFX8: Strings are not displayed in TableView

I have the following problem: I try to populate a tableview in JavaFX8 with an array. So, I try to add the array as a row to the tableview. I run this code in the Controller of my FXML file, when enter is pressed. This is the code: String[] words =…
bashoogzaad
  • 4,611
  • 8
  • 40
  • 65