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

jfxtras CalendarTextField cannot be loaded in Scene Builder

I am using Netbeans and Scenebuilder to create a JavaFX project. I realized that Scenebuilder does not have a date picker component so I downloaded the jfxtras and added the library to my classpath. I used the following code to add the…
unleashed
  • 331
  • 1
  • 5
  • 17
1
vote
1 answer

JavaFX FXML table; why won't my data display

I'm trying to create a simple table using FXML. The table displays fine, but it's not displaying my data. Here's my main program. public final class TableTest extends Application { @Override public void start(final Stage primaryStage) { …
Tim Fletcher
  • 125
  • 3
  • 13
1
vote
1 answer

JavaFX - load FXML into FXML without include

I have a window created with FXML in the corresponding controller, I have a button, which loads a small box when a specific button is clicked. The box is designed using FXML as well. When I load the box and want to add it into the window, I get this…
user1406177
  • 1,328
  • 2
  • 22
  • 36
1
vote
2 answers

Is it possible to add a separator in a javafx choicebox in FXML?

This document describes how to add a separator to a javafx 2 choicebox by code: http://docs.oracle.com/javafx/2/ui_controls/choice-box.htm I would like to achieve the same using a FXML layout. Any ideas?
shadowhorst
  • 1,480
  • 13
  • 21
1
vote
1 answer

Minimise JavaFx window Using FXML

I am new to Javafx , i am working on javafx project . I want to minimise javafx window . i use primaryStage.initStyle(StageStyle.UNDECORATED); . I also want to add clickevent to the imageview in fxml.
Codelord
  • 1,120
  • 2
  • 10
  • 21
1
vote
1 answer

How to add transition animation for switching JAVA FX FXML

1) How to add transition animation in javafx when switching between fxml files. 2) How to add css effects in buttons like hover effect and popular button effect. I am working javafx project. I having trouble to changing fxml with using animation…
Codelord
  • 1,120
  • 2
  • 10
  • 21
1
vote
1 answer

Adding a TilePane instantiated in .java files to FXML

I'm trying to add a TilePane with ImageView children to a scene in JavaFX. Currently, my FXML is loading an empty TilePane. The current FXML line that i have making the TilePane is
nostrebor
  • 309
  • 1
  • 3
  • 12
1
vote
1 answer

How to communicate between the Model and View in a Java FX FXML application?

Disclaimer: I'm very new to JavaFX and Model-View-Controller design principles. Here's my basic situation: I have a ScreenManager similar to the one outlined in this tutorial. Using the screen manager, I switch between several FXML screens using…
s_dolan
  • 1,196
  • 1
  • 9
  • 21
1
vote
1 answer

Having image display based upon passed criteria using JavaFX and FXML

I have an app that I want to have an ImageView element in the FXML file display either an image, or a blank section dependant on user input. I was thinking either to somehow surround the FXML imageview element in an if/else block, or to pass either…
canadiancreed
  • 1,966
  • 6
  • 41
  • 58
1
vote
1 answer

JavaFX stylesheet not applied when fxml loaded node is added as a child

I have an fxml file that references a css file. When I load this fxml and set it as the root of my scene, the css is applied nicely. However when I create a custom Region (with getChildren made public), and add the loaded fxml node to it, no css is…
Zubzub
  • 782
  • 7
  • 18
1
vote
1 answer

Can't load FXML with webstart

First off my jar file works fine, but every time I try to start the .jnlp I get a runtime exception and this CacheEntry[file:/C:/Users/Erick/Documents/GitHub/TarotBuddyOnline/out/artifacts/JavaFXApp/JavaFXApp.jnlp]:…
Erick Moore
  • 325
  • 1
  • 2
  • 5
1
vote
1 answer

Checkbox cell in tableview on JavaFX

I'm try create checkbox cell in tableview using FXML. Checkbox appear but not active. Clicking on it does not change its state. This is my FXML file
Andrey
  • 11
  • 3
1
vote
1 answer

Update FXML Screen

I want to update a Screen, which i created with a FXML-file. I though this: Link was the solution, but i dont get the code to run. I found some other parts of code but no one worked for me. I am not shure if i use a different version (see Link) or…
user2111880
  • 671
  • 9
  • 17
1
vote
1 answer

How to import external JS-script to FXML layout?

I have FXML layout and I want to add external JS file (like src="http://blablabla.org/bla.js" in HTTP), I've tried following:
skayred
  • 10,603
  • 10
  • 52
  • 94
1
vote
2 answers

javafx: fxml: display elements twice

I was wondering if there is a simple way to clone elements in FXML (such as textboxes) to display them more then one time. Following situation: I have a TabView and want to display on the first Tab elements X, on the second Tab elements Y and on…
hitchdiddy
  • 129
  • 1
  • 1
  • 5
1 2 3
99
100