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.

Filter by
Sorted by
Tagged with
228 votes
10 answers
232k views

Passing Parameters JavaFX FXML

How can I pass parameters to a secondary window in javafx? Is there a way to communicate with the corresponding controller? For example: The user chooses a customer from a TableView and a new window ...
Alvaro's user avatar
  • 11.9k
105 votes
5 answers
88k views

JavaFX - setVisible hides the element but doesn't rearrange adjacent nodes

In JavaFX, if I have a scene with 2 VBox elements and each VBox has multiple Label in it. If I set the top VBox to invisible, why does the bottom VBox not move up the scene where the top VBox was ? ...
Gillardo's user avatar
  • 9,766
95 votes
3 answers
69k views

Where has the JavaFX scene builder gone?

I am trying to find the elusive JavaFX scene builder so I can use it in Intellij. I am on Windows OS. Oracle have stated that the JavaFX scene builder is included in a new download, but no matter how ...
tentimes's user avatar
  • 1,462
80 votes
4 answers
112k views

Accessing FXML controller class

I would like to communicate with a FXML controller class at any time, to update information on the screen from the main application or other stages. Is this possible? I havent found any way to do ...
betaman's user avatar
  • 1,885
70 votes
26 answers
168k views

JavaFX 2.1 TableView refresh items

I have this common issue, as it appears to be. My table view wont refresh my items after I reset them. I have checked the data and it's the new one. I tried multiple solution from internet but no ...
user1236048's user avatar
  • 5,582
68 votes
3 answers
38k views

Label and Text differences in JavaFX

What is the difference between javafx.scene.text.Text and javafx.scene.control.Label? The documentation says: Label is a non-editable text control. The Text class defines a node that displays a ...
Marlord's user avatar
  • 1,153
67 votes
9 answers
212k views

close fxml window by code, javafx

I need to close the current fxml window by code in the controller I know stage.close() or stage.hide() do this in fx how to implement this in fxml? I tried private void on_btnClose_clicked(...
alfredo138923's user avatar
62 votes
2 answers
27k views

Remove the default 'no content in table' text for empty javafx table

I would like to remove or change the default text shown by an empty javafx table from No content in table to something more meaningful for the user. For example in a table showing students, when ...
Japheth Ongeri - inkalimeva's user avatar
50 votes
3 answers
99k views

How to reference javafx fxml files in resource folder?

I am creating a javafx GUI application and my project is a maven configured project. I want to be able to reference my fxml files like this in my controllers: FXMLLoader.load(getClass().getResource(&...
j will's user avatar
  • 3,797
49 votes
6 answers
119k views

JavaFX Panel inside Panel auto resizing

I have a JavaFX application which has only one FXML file. In this file I have one AnchorPane which has a StackPane inside it. Here is the screenshot: When I start this application, I want to resize ...
Korki Korkig's user avatar
  • 2,784
47 votes
9 answers
119k views

JavaFX FXML API version warning

I have recently started noticing the following warning when starting my JavaFX application: WARNING: Loading FXML document with JavaFX API of version 8.0.65 by JavaFX runtime of version 8.0.60 ...
Itai's user avatar
  • 6,811
44 votes
15 answers
47k views

IntelliJ IDEA - getClass().getResource("...") return null

I'm using IntelliJ IDEA 13.1.5, I used to work with Eclipse. I'm working on JavaFX application, I try to load FXML file within my MainApp class using getClass().getResource(). I read the documentation ...
BilalDja's user avatar
  • 1,072
44 votes
4 answers
54k views

How to create custom components in JavaFX 2.0 using FXML?

I can't seem to find any material on the subject. To give a more concrete example, let's say I want to create a simple component that combines a checkbox and a label. Then, populate a ListView with ...
Andrey's user avatar
  • 9,012
43 votes
9 answers
108k views

Loading new fxml in the same scene

I have 2 fxml files: Layout (header, menubars and content) Anchorpane (it's supposed to be placed inside the content from the other fxml file) I would like to know how can I load the second file ...
Andre's user avatar
  • 617
40 votes
5 answers
97k views

How to make window fullscreen/maximized in Scene Builder?

I am making a view in SceneBuilder for my JavaFX application. I want my view to be maximized. How can I achieve this in SceneBuilder or the .fxml file?
Navi89CZ's user avatar
  • 421
37 votes
3 answers
68k views

Customize ListView in JavaFX with FXML

I want to make a customize list view in javafx. Here I need to bind multiple component in list cell as follow, like one label, one textfield, one button under one HBox and two button, one hyperlink, ...
Santosh Biswakarma's user avatar
36 votes
2 answers
20k views

FXML full reference?

I'm trying to learn JavaFX 2.0 + FXML, and i found it kind of uncomfortable to make fxml file, without knowing what i can put in it and what i can't. I mean which tags are possible in FXML, which ...
Victoria Agafonova's user avatar
35 votes
8 answers
27k views

How to control the JavaFX Tooltip's delay?

I was playing around with JavaFX's Tooltip. I realized that for me personally the delay between hovering over something and the tooltip actually appearing is too long. A look in the API reveals: ...
Turing85's user avatar
  • 19.3k
35 votes
8 answers
124k views

How to switch scenes in JavaFX

I have looked on many pages to try and find out how to switch scenes but I have been unsuccessful. I have a calculator and my goal is to select a menu option to change Calculators(ie: basic and ...
Megan's user avatar
  • 504
34 votes
7 answers
39k views

Why would scenebuilder 2.0 fail to open my fxml file?

I have an fxml file that I created using SceneBuilder 2.0. This file is used in my JavaFx project that I am developing using Netbeans 8. Today, SceneBuilder stopped working with my file. When I tried ...
Justin Wiseman's user avatar
33 votes
2 answers
77k views

How do I add margin to a JavaFX element using CSS?

I have the following fragment of FXML: <VBox fx:id="paneLeft"> <TextField promptText="Password"/> <Button fx:id="btnLogin" text="Login" maxWidth="10000"/> <Hyperlink ...
vbezhenar's user avatar
  • 11.9k
31 votes
5 answers
90k views

How to get selected radio button from ToggleGroup

I an working on JavaFX 8 and SceneBuilder. I created some radio buttons in the FXML File and specified a toggleGroup name to a radio button list in that. So, now I want to get the toggleGroup's ...
rjalfa's user avatar
  • 739
31 votes
3 answers
73k views

Styling a JavaFX 2 button using FXML only - How to add an image to a button?

I want to change the styling of a button, most of the threads here and the articles on the internet show how to do it using Java code, which I don't see it as a real good solution, is there any way ...
AymenDaoudi's user avatar
  • 8,071
31 votes
1 answer
30k views

JavaFX Project Structure

JavaFX's MVC Model by using FXML sounds awesome and all but I'm having trouble find out how to organize my project packages. Every single tutorial i find about JavaFX is way too simple and ...
Xkynar's user avatar
  • 935
31 votes
4 answers
64k views

How to create multiple javafx controllers with different fxml files?

I've been looking at some blogs and other stackoverflow questions, and I'm not seeing a direct answer to my question. I am creating a javafx gui client and I want to have my menubar be one controller ...
j will's user avatar
  • 3,797
30 votes
6 answers
96k views

JavaFX: FXML: How to make the child to extend its size to fit the parent pane?

I have managed to load a child fxml(sub UI) under a parent fxml (mainMenu UI). I have created an AnchorPane with id "mainContent". This pane is bound to 4 sides and changes in accords to the stage. ...
Dean Chiu's user avatar
  • 1,345
29 votes
2 answers
42k views

Multiple FXML with Controllers, share object

Goodevening everyone, I have found a bunch of posts already on this topic but I still can not manage to pass an object from Controller1 to Controller2. Is there somewhere a full tutorial or some ...
Perneel's user avatar
  • 3,347
29 votes
2 answers
39k views

JavaFX Nested Controllers (FXML <include>)

In this tutorial, there is an example of how to include custom components and use their controllers from the controller of the container. main_window_content.fxml <VBox fx:controller="com.foo....
Antonello's user avatar
  • 321
28 votes
2 answers
44k views

How to embed .ttf fonts in JavaFx 2.2?

Firstly, I am quite a new guy in coding. I need to embed a font in my java FXML-based app and don't know how to do it. I have pasted the font, fontName.ttf in a "resources" folder in the ...
Pratik Anand's user avatar
28 votes
3 answers
29k views

How to initialize JavaFX controllers with the same model object?

Scenario I am creating a GUI where multiple views reference the same model object. What I am Accustom to In Swing, if i want all the views to reference the same model i would pass the model into ...
j will's user avatar
  • 3,797
26 votes
2 answers
79k views

Javafx open another fxml in the another window with button

Is it possible in javafx to open new stages (windows) from another fxml with a button? Thanks for the answers.
Sevi's user avatar
  • 625
26 votes
5 answers
94k views

How to handle ListView item clicked action?

I have my JavaFX 2.0 application, where i need to make some action, after user clicked an item in ListView element. To construct user GUI i'm using FXML, in which i have something like this: &...
Victoria Agafonova's user avatar
26 votes
1 answer
30k views

How to get parent Window in FXML Controller?

For example, I want open a DirectoryChooser when clicking on the button: <VBox fx:controller="com.foo.MyController" xmlns:fx="http://javafx.com/fxml"> <children> <...
nvcnvn's user avatar
  • 5,081
25 votes
2 answers
47k views

FXMLLoader getController returns NULL?

I have the main application class that does the following just fine: @Override public void start(Stage primaryStage) { try { FXMLLoader loader = new FXMLLoader(getClass()....
Toni_Entranced's user avatar
23 votes
1 answer
21k views

What is the "mnemonicParsing" attribute in Java FX

I have been working with SceneBuilder and I observe that it applies the attribute of mnemonicParsing and equates it to false for every Node that I make. What exactly is it? What difference does it ...
Tilak Madichetti's user avatar
22 votes
3 answers
26k views

Is @FXML needed for every declaration?

Is @FXML needed for every declaration or just for the first? In other words, should I use @FXML public Label timerLabel = new Label(); @FXML public TextField mainTextField, projectTextField ; @FXML ...
Romeo's user avatar
  • 311
22 votes
6 answers
33k views

Default JavaFX-CSS

Is there any way to see the applied CSS-Rules for JavaFX-Elements? Or there is a published reference with the default CSS-Rules available? I would like, for example , to know the color of Toolbar's ...
Gundon's user avatar
  • 2,111
22 votes
1 answer
54k views

Java FX fxml on Action

I want to add a method to a button which is defined in my Controller class in the console is only an error which tells me that it couldn't find the method here is the code sample.fxml <?xml ...
Jhon Smith's user avatar
21 votes
4 answers
36k views

Bootstrap with JavaFX

I am creating a GUI in a java fxml project using netbeans. I wanted to use bootstrap to style the gui but I have noticed that everything in javafx is prefixed with fx-. Is there still a way to get ...
jamespick's user avatar
  • 1,972
20 votes
1 answer
75k views

JavaFX How to set max/min window size?

Does setMinSize() work on containers such as GridPane, for example? I have found that in my program GridPane ignores min. size properties while resized manually. Here is the FXML code: <GridPane ...
Chechulin's user avatar
  • 2,446
20 votes
2 answers
31k views

How to change sub fxml gui parts at runtime with Button Click

I'm tryin to build a skeleton for a big complex gui, so the idea is to make everything with mvc like style in javafx 2.1, so every component has a fxml file and if needed css,controller and model. I'm ...
Snow's user avatar
  • 223
20 votes
2 answers
22k views

JavaFX 8 - Tabpanes and tabs with separate FXML and controllers for each tab

I hope to get some answers regarding having fx:include statements for each tab in a tabpane. I have managed with ease to get content to show up BUT referencing methods of the associated controller ...
Måns Thörnvik's user avatar
19 votes
3 answers
39k views

ComboBox FXML default value

How can I set a default value in a ComboBox using FXML? <ComboBox fx:id="cbo_Bacteriologie_Aesculine" prefHeight="21.0" prefWidth="105.0" GridPane.columnIndex="1" GridPane.rowIndex="0"> <...
Perneel's user avatar
  • 3,347
19 votes
7 answers
138k views

How can I show an image using the ImageView component in javafx and fxml?

I suppose it's a very simple thing but I just can't get behind it. All I want is to show an image over an ImageView linked to fxml. Here is my code: package application; import java.io.File; import ...
user3472050's user avatar
19 votes
8 answers
44k views

Can I automatically generate controller classes from FXML?

As I understand it, when using FXML to describe a Java FX scene, the controller class is written manually and it's member variables and methods can then be referenced from the .fxml file. When loading ...
Feuermurmel's user avatar
  • 9,725
19 votes
2 answers
93k views

How to position a button (or any GUI element) in a JavaFX scene?

I am trying to put a JavaFX button in a specific place (specific coordinates) on a UI, but nothing is working. I'm guessing that there is a method that is used for this, but I can't find it.
Milos Maksimovic's user avatar
19 votes
1 answer
12k views

Set multiple styleClass values

How does one set two classes on a node in a JavaFX FXML file? <VBox styleClass="notice high"> This adds one value "notice high" instead of two values "notice" and "high". How can I add two ...
John Kugelman's user avatar
18 votes
7 answers
26k views

RequestFocus in TextField doesn't work

I use JavaFX 2.1 and I created GUI using FXML, in the controller of this GUI I added myTextField.requestFocus();. But I always get the focus in the other control.
Adil's user avatar
  • 4,583
18 votes
3 answers
33k views

How to reference primaryStage [duplicate]

I use .fxml-Files for the view-layer of my application. Each fxml has a controller attached to it <AnchorPane fx:controller="movielistjavafx.view.MainWindowController"> Let's assume I have a ...
Gundon's user avatar
  • 2,111
18 votes
3 answers
13k views

Getting started on Scala + JavaFX desktop application development

Is there some guide or walkthrough to building a Scala + JavaFX desktop application? I'm having hard time finding a good source and I am using IntelliJ IDEA as the IDE. Even the most simplistic ...
Tower's user avatar
  • 101k

1
2 3 4 5
73