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

JRuby class & Java baseclass: making private java methods available to child

I have a JRuby child class with a Java parent class. I need to override the Java function so that when it is called my JRuby method implementation is called first. The problem is that the java method is private. Any ideas?* // Java: public class…
inyourcorner
  • 683
  • 9
  • 26
1
vote
4 answers

java FXML generated code

im studying programing at university, 2nd year now, and im getting started with java fxml scene builder. i know the basics and how to connect the code with the @FXML thing and so on. but im with a big problem. so, i basically create my window, some…
Pedro Costa
  • 427
  • 3
  • 13
  • 31
1
vote
2 answers

JavaFX Circle and ImageView

I need to use javaFX2 to do the following: 1-) Load an image and display it using imageView. [OK] 2-) Right click and choose the "Add Node" option and a black circle will appear in the screen and you can Drag the circle to any place of the image.…
tsukanomon
  • 1,220
  • 1
  • 19
  • 23
1
vote
2 answers

Controller returning null in javafx helloworld

So of course I dive straight in to creating a simple example. public class Main extends Application { URL bla = getClass().getResource("/sample.fxml"); @Override public void start(Stage primaryStage) throws Exception{ //If you get weird…
Daniel Gerson
  • 2,159
  • 1
  • 19
  • 29
1
vote
2 answers

Loop / foreach in JavaFX with FXML

My question is very simple but I don't find the answer. I would to create a form in JavaFX with fxml file which browses a list of TextField. This list is filed in Java but how can I browse this list in fxml ? Is it possible to do something like…
Kiva
  • 9,193
  • 17
  • 62
  • 94
1
vote
1 answer

How remove warning at compile in in java fxml application in netebeans

I have a JavaFX application using fxml and JavaFX Scene Builder 1.1. When I compile the project in Netbeans, it gives warnings for each jar file that is included in the project which makes it takes more time to compile. For example: Warning: The…
java baba
  • 2,199
  • 13
  • 33
  • 45
1
vote
0 answers

Determing JavaFX Chart Size using FXML

I'm working on a value marker for a line chart in JavaFX 2.2. I therefore used the answer on an existing question here on stackoverflow and the example by Sergey Grinev is working fine. However, if I want to use FXML to add a chart instead of adding…
Horrorente
  • 314
  • 3
  • 13
1
vote
1 answer

javaFXML PathTransitionproblem

I have a question. I am learning JavaFX and I would like to use the javaFXML. The only problem is, I have a little problem with a pathTransion. You need a Node for the pathTransition, but I want to use a rectangle which is made in the…
Gilian Joosen
  • 486
  • 3
  • 21
1
vote
2 answers

JavaFX dynamically swapping elements

I want to have a form that has some basic header information (name, date, etc.). Under this header information the user should be able to choose from a ChoiceBox. Below the ChoiceBox there is a ScrollPane. The content of the ScrollPane should be…
fancy
  • 2,077
  • 2
  • 23
  • 45
1
vote
0 answers

JavaFX: Why most of the examples of the web do not separate the layers View and Controller using, for example, files fxml?

Most of the source codes I find on the web about JavaFX show codes with the View and Control layers in one source. So the code that creates the visual components are attached to the methods corresponding to events, ie, layers View and Controller are…
Sandro TC
  • 11
  • 3
1
vote
3 answers

Property anottated with @FXML is null When i use Spring Security and Javafx

i am developing an Javafx application with Spring Security enabled in it. then, i have created a fxml form which have a textField with id equals to txtField. later i anottated a method with @Secured Anottation, but when i try to set text to…
kato2
  • 535
  • 4
  • 15
1
vote
1 answer

javafx fxml is null outside initialize()

In this code: public class ESM extends Application { private Stage primaryStage; @FXML private ToolBar mainToolBar; @Override public void start(final Stage stage) throws Exception { try{ this.primaryStage = stage; Parent…
Rob
  • 2,511
  • 2
  • 20
  • 31
1
vote
1 answer

FXML controller class too large

So I've been practising with JavaFX for a while now and while I love it, I find that my application is growing in size- especially in terms of the number of lines of codes for my FXML Controllers. Right now a typical package for each scene in my…
Nepze Tyson
  • 587
  • 2
  • 7
  • 16
1
vote
1 answer

JavaFX Builder 1.0 unable to open a file

I get the following error when I try to open a .fxml file from Netbeans: StaffRota.fxml:101: error: java.lang.IllegalArgumentException: Invalid URL or resource not found the code I have in that xml is:
obsessiveCookie
  • 1,130
  • 2
  • 18
  • 33
1
vote
1 answer

Menu Button that does not dismiss options onclick in JavaFX 2

I am quite new in JavaFX and I have a question about the design. I am creating my main menu in FXML using Scene Builder. I have various menu buttons and each of these have a sub-menu. These sub-menu options will open new windows. Is it possible to…
Damian
  • 461
  • 1
  • 7
  • 18
1 2 3
99
100