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

CSS Color Parsing Error

I get the error message: Jun 25, 2014 11:39:18 AM com.sun.javafx.css.parser.CSSParser term WARNING: CSS Error parsing '*{-fx-background-color:8ACC49;}: Unexpected token '8ACC' at [1,23] I have an array of styles to set the background color: private…
Armandt
  • 311
  • 1
  • 3
  • 8
1
vote
1 answer

Call javascript function defined in FXML document from Java

I'm using FXML documents to define JavaFX layouts and have been using Java controllers but am now looking at javascript event handlers directly in the FXML documents. I'm wondering if anyone knows how to call a Javascript function defined in a FXML…
Daniel Walton
  • 113
  • 1
  • 11
1
vote
1 answer

javafx how to transfer variable values from one controller to another

i am new to javafx and i want to transfer variable values from one controller to another and i have no idea how to do this. so please help me. for example: i want to display username from first login window to second dashboard window so what should…
user3204934
  • 485
  • 6
  • 15
1
vote
1 answer

JavaFX GridPane inside ScrollPane inside GridPane can't set ScrollPane Growing

Hi all ! I've got a simple question: I'm using FXML files and I've done this layout: I am trying to expand the height of the Scrollpane inside the column 1 (row span 3) With this hierarchy: (top GridPane controller is hightlighted - it is inside a…
neuronsoverflow
  • 133
  • 4
  • 14
1
vote
1 answer

Issues with migrating to JavaFX 8

I have recently installed the new Java 8u5 update so I can use lambda operations and the new Scene Builder, however I immediately had problems loading the FXML documents. Before I did it in a different thread and used Platform.runLater(...) to load…
Cobbles
  • 1,748
  • 17
  • 33
1
vote
0 answers

How to set a different Id with @FXML?

It is very nice to use the @FXML annotation so the FXMLLoader can inject the fields with an instance of the control with the same id as the field name. But it would be nice, if I can set a different id than the field name. For example in the FXML…
Vertex
  • 2,682
  • 3
  • 29
  • 43
1
vote
0 answers

What are some method(s) default internationalization ".properties" with FXML?

I would like to establish a default internationalization string properties resource for a FXML scene file. The reference tutorial: Internationalizing Your FXML Layout see: Preview menu item / Internationalization command / Set Resource…
will
  • 4,799
  • 8
  • 54
  • 90
1
vote
1 answer

Reference and Guidelines for Dynamic Layout using JavaFX

I am using FXML via Scene Builder to establish some JavaFX scenes and formatting templates. Having scanned the web and Oracle tutorials, I still find determining the 'rules' around how layouts size/wrap/fit-contents/etc. and spacing between…
will
  • 4,799
  • 8
  • 54
  • 90
1
vote
1 answer

Adapt Stage size to its children in JavaFx2 and MigLayout 4.2

I have an app where we manage multiple screens. In order to do that we have the next code (I will add only the important methods). ScreenManager.java public class ScreenManager extends StackPane { private final HashMap screens =…
maqjav
  • 2,310
  • 3
  • 23
  • 35
1
vote
2 answers

Change the color of a single data cell in a TableView

I have a column in a table view and i want: Green font if i write "OK", red font if i write "KO". The problem is that i try to modify this value in the method "setCellFactory" but it doesn't work because the String have all the same color (red or…
Peppalvino
  • 23
  • 1
  • 6
1
vote
1 answer

How can I style a JavaFX SplitMenuButton in CSS

I try to style a SplitMenuButton in JavaFX. I've got a menuButton and a SplitMenuButton in my fxml-file. My CSS-File looks like this: .menu-button { -fx-background-color: red; } .split-menu-button .label { -fx-background-color: green; …
stefOCDP
  • 803
  • 2
  • 12
  • 20
1
vote
2 answers
1
vote
1 answer

How to get an imageView in a fxml file

i have this fxml file
user2768684
1
vote
1 answer

Why TableView / TableColumn is not editable?

From the following FXML:
Aubin
  • 14,617
  • 9
  • 61
  • 84
1
vote
1 answer

java.lang.reflect.InvocationTargetException when i try to change the label's text value

Here is a simple label project for javafx using fxml with netbeans. The problem is, when I use StartFomulars.setText("abc"); It just gets an exception given below. Here is the code for main, package main; import…
Loki
  • 13
  • 3