Questions tagged [javafx]

The JavaFX platform enables developers to create and deploy Graphical User Interface (GUI) applications that behave consistently across multiple platforms. JavaFX 1.3 and older, were scripting languages, whereas JavaFX 2.x+/8.x enables users to use Java. FXML enables JavaFX to follow an MVC architecture.

The JavaFX platform enables developers to create and deploy Graphical User Interface (GUI) applications that behave consistently across multiple platforms. It is built on java technology and was part of the Oracle JDK from JDK 8 until Java 10. Since JDK 11, JavaFX is shipped as a library, independent of most JDK and JRE distributions.

External Resources

Tag Usage

  • javafx accumulates questions on all version as it tends to be used on the current version at the time the question is asked.
  • javafx-18 is dedicated to questions that are specific to the JavaFX 18 version.
  • javafx-17 is dedicated to questions that are specific to the JavaFX 17 version.
  • javafx-11 is dedicated to questions that are specific to the JavaFX 11 version.
  • javafx-8 is dedicated to questions that are specific to the JavaFX 8 version.

Outdated tags - do not use, instead update your environment to a recent version

  • javafx-2 is dedicated to questions that are specific to the JavaFX 2+ version.
  • javafx-1 is dedicated to questions that are specific to JavaFX 1.x releases which used JavaFX Script language

Frequently Asked Questions

People often ask these questions about this topic:

Installation

Resource Lookup

FXML

Packaging

Virtualized Controls

Misc

38047 questions
365
votes
3 answers

Google Maps & JavaFX: Display marker on the map after clicking JavaFX button

I have been trying to display a marker on the map when I click on a Button of my JavaFX application. So what happens is when I click on that button, I write the position in a JSON file, this file will be loaded in the html file that contains the…
Chandler Bing
  • 1,036
  • 2
  • 8
  • 14
225
votes
10 answers

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 is opened, showing the customer's info. Stage…
Alvaro
  • 11,797
  • 9
  • 40
  • 57
211
votes
6 answers

Swing vs JavaFx for desktop applications

I have a very big program that is currently using SWT. The program can be run on both Windows, Mac and Linux, and it is a big desktop application with many elements. Now SWT being somewhat old I would like to switch to either Swing or JavaFX. And I…
Quillion
  • 6,346
  • 11
  • 60
  • 97
208
votes
17 answers

JavaFX Application Icon

Is it possible to change the application icon using JavaFX, or does it have to be done using Swing?
Sebb77
  • 2,431
  • 2
  • 17
  • 18
132
votes
8 answers

JavaFX and OpenJDK

I'm trying to decide whether I could switch to JavaFX for the user interface of my Java application. Most of my users would be using the Oracle JRE, which has JavaFX integrated these days. However, some are using OpenJDK (on linux). This (old)…
mdriesen
  • 1,492
  • 2
  • 10
  • 11
122
votes
1 answer

Error: JavaFX runtime components are missing, and are required to run this application with JDK 11

I'm trying to run the sample JavaFX project using IntelliJ but it fails with the exception : Error: JavaFX runtime components are missing, and are required to run this application I have downloaded JDK 11 here : http://jdk.java.net/11/ I have…
Maxoudela
  • 2,091
  • 3
  • 15
  • 23
118
votes
5 answers

Is it possible to run JavaFX applications on iOS, Android or Windows Phone 8?

Can one develop an entire application using JavaFX and run it on iOS, Android or Windows Phone 8, without writing platform-specific code?
mjs
  • 21,431
  • 31
  • 118
  • 200
111
votes
3 answers

JavaFX FXML controller - constructor vs initialize method

My Application class looks like this: public class Test extends Application { private static Logger logger = LogManager.getRootLogger(); @Override public void start(Stage primaryStage) throws Exception { String resourcePath =…
mrbela
  • 4,477
  • 9
  • 44
  • 79
105
votes
24 answers

What is the recommended way to make a numeric TextField in JavaFX?

I need to restrict input into a TextField to integers. Any advice?
Harry Mitchell
  • 1,100
  • 2
  • 7
  • 12
103
votes
4 answers

Platform.runLater and Task in JavaFX

I have been doing some research on this but I am still VERY confused to say the least. Can anyone give me a concrete example of when to use Task and when to use Platform.runLater(Runnable);? What exactly is the difference? Is there a golden rule to…
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364
103
votes
8 answers

How to get stage from controller during initialization?

I want to handle stage events (i.e. hiding) from my controller class. So all I have to do is to add a listener like this: ((Stage) myPane.getScene().getWindow()).setOn*whatIwant*(...); But the problem is that initialization starts right after this…
Chechulin
  • 2,426
  • 7
  • 28
  • 35
102
votes
5 answers

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 ? The VBox is invisible but I would expect the…
Gillardo
  • 9,518
  • 18
  • 73
  • 141
101
votes
7 answers

IntelliJ can't recognize JavaFX 11 with OpenJDK 11

I'm having trouble getting IntellJ to recognize JavaFX packages. With a new JavaFX project, with OpenJDK 11, when trying to build the project, IntelliJ can't recognize the JavaFX packages. I've imported openjfx:javafx-base-11 from the Maven…
AlwaysNeedingHelp
  • 1,851
  • 3
  • 21
  • 29
101
votes
2 answers

How does JavaFX compare to WPF?

I'm mostly a C# programmer, I stopped writing Java about 10 years ago, but I try to keep up with the technology in Java by reading articles, talking with friends, etc. I've heard about the new rich GUI framework called JavaFX, but couldn't find any…
Aviad P.
  • 32,036
  • 14
  • 103
  • 124
95
votes
3 answers

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 I search I cannot find it (see…
tentimes
  • 1,462
  • 1
  • 11
  • 16
1
2 3
99 100