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

JavaFX Load Exception

I'm trying to make a basic calculator application with JavaFX but I'm having trouble launching the application. This is the error I get Exception in Application start method java.lang.reflect.InvocationTargetException at…
ulqy
  • 13
  • 1
  • 1
  • 4
1
vote
1 answer

Opening another JavaFX app from within another?

I am trying to open up another app on top of one that is already open. In other words, I have the initial app that does stuff, and I have a button on the window that, when clicked, should open up another window with performance and memory…
G Boggs
  • 381
  • 1
  • 6
  • 19
1
vote
1 answer

SceneBuilder coordinates vs. JavaFX coordinates

I'm trying to make a game using JavaFX with FXML and scenebuilder. Currently I'm trying to make an event where when the user moves the player image to another image onscreen, and presses space, a small window pops up(supposed to be a shop like…
Keanu
  • 207
  • 2
  • 3
  • 9
1
vote
1 answer

Perform action on showing FXML with JavaFX 8

I am building a JavaFX application with multiple screen, and therefore multiple FXML files with their controllers. The initialize method of the controller is already done when the application starts for all FXML files. I have a lockscreen, where a…
bashoogzaad
  • 4,611
  • 8
  • 40
  • 65
1
vote
2 answers

Load Java FXML from sub package of start class

It must be a very simple thing to do perhaps but some how none of the solutions worked for me so far. So finally the question, maybe something that I didn't take in account. I want to load FXML with its controller from sub package of the start class…
Indigo
  • 2,887
  • 11
  • 52
  • 83
1
vote
0 answers

JavaFX Custom Control Can't move fxml in package --> FileNotFoundException

I have created a new (Control) Class that extends of BorderPane. This class loads an FXML in the constructor. In another fxml, I am using this Control this way . It works perfectly, however, as soon as I try to move MyController.fxml (and its class…
Jamesst20
  • 404
  • 6
  • 21
1
vote
1 answer

No content in TableView

I want to load some data from a database into my tableview.I've got a code and it works fine but no my tableview is empty .... Here is my fxml file:
Chris
  • 599
  • 3
  • 11
  • 24
1
vote
1 answer

External jar FXML Load Exception

I try to load a class located in an external jar using classloader. The class "FXMLbase" loads ok, but the error is triggered when the FXMLdocument.fxml try to instantiate the FXMLDocumentController. However when the "FXMLbase" is instantiate…
1
vote
1 answer

JavaFX Using alternative FXML structure for Title (Stage is root)

I read answer about putting Title in FXML (JavaFx : Set window title in fxml file), but I don't understand how to call this code. I can't call it in the classic way: FXMLLoader loader = new FXMLLoader(getClass().getResource("some.fxml")); Scene…
user1776503
  • 15
  • 1
  • 6
1
vote
1 answer

JavaFX Redirected System.out stream TextArea,only working when not used as FXML Component with fixedID.Why?

So this was pretty confusing for me.I decided to redirect application console, into TextArea in my UI. Bud when i did that with Fixed TextArea(Fixed ID) in SceneBuilder and then annotated @FXML private TextArea consoleTextArea; Nothing happen.No…
Tomas Bisciak
  • 2,801
  • 5
  • 33
  • 57
1
vote
0 answers

JavaFx silently fails on FXML binding errors

We are working on a JavaFx 2.2 Desktop Application. The workflow is fine, creating FXML Files using the Scene Builder and attaching them into my controllers using the FXML annotation. However it would be nice if JavaFx could give me some debugging…
nob
  • 1,404
  • 10
  • 13
1
vote
3 answers

How do I stylize a Text Shape in JavaFX using a CSS style sheet without assigning it a style-class?

I have a fairly simple JavaFX control that I am trying to stylize with a CSS stylesheet. I have the background set up fine but I have several Text shapes that are necessary because the control itself can vary in size and I want to scale the text…
Will
  • 3,413
  • 7
  • 50
  • 107
1
vote
1 answer

What is an fx:controller and why do all the tutorials give me errors?

Okay so I'm following a bunch of tutorials online for Java FX and FXML, but I'm not understanding what is an fx:controller and why does my code always say there's an error with it? Can someone tell me why does Netbeans make three classes when I make…
user3505901
  • 408
  • 1
  • 6
  • 19
1
vote
2 answers

How can we make text auto scroll continuious loop?

I'm looking for a method to make some lines of text auto-scroll continuous loop with JavaFX. This is very similar to the credits-like scrolling in these questions below. It is a workstation screen, not a mobile. The text is kind of fixed, not from…
will
  • 4,799
  • 8
  • 54
  • 90
1
vote
2 answers

MigPane compatibility with FXML and Scene Builder

Before I jump on the MigPane bandwagon I would like to know: Is it possible to specify MidPane layouts in a .fxml file? If so: can someone point me to some examples? Is it possible to use Scene Builder 2.0 to edit a .fxml file containing…
ZioByte
  • 2,690
  • 1
  • 32
  • 68