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
93
votes
13 answers

cannot resolve symbol javafx.application in IntelliJ Idea IDE

I tried to create a JavaFX application in IntelliJ Idea IDE but I got compile error that said: java: package javafx.application does not exist. I have changed the Project SDK and the Project Language Level to Java 8, reloaded the project but it…
rob111
  • 1,249
  • 1
  • 13
  • 18
92
votes
11 answers

Using JavaFX in JRE 8, “Access restriction” error

When trying to use javafx related classes in my new java 8 project I get an access restriction error from eclipse. So far the only 'solution' I've been able to find is to tell eclipse to ignore the access restriction, but I am not satisfied with…
Lexxicon
  • 1,161
  • 1
  • 10
  • 10
91
votes
16 answers

javac: invalid target release: 1.8

I recently downloaded JDK 1.8.0.0_06 that comes bundled with NetBeans. I then got to find out that my JavaFx project, that I have been developing in Java 1.7 won't compile in Java 1.8, and so I stepped down my JDK to 1.7. Still I can't get it to…
Program-Me-Rev
  • 6,184
  • 18
  • 58
  • 142
90
votes
6 answers

JavaFX periodic background task

I try to run in JavaFX application background thread periodically, which modifies some GUI property. I think I know how to use Task and Service classes from javafx.concurrent and can't figure it out how to run such periodic task without using…
Michał Króliczek
  • 1,319
  • 1
  • 11
  • 16
88
votes
13 answers

How to close a JavaFX application on window close?

In Swing you can simply use setDefaultCloseOperation() to shut down the entire application when the window is closed. However in JavaFX I can't find an equivalent. I have multiple windows open and I want to close the entire application if a window…
Kshitiz Sharma
  • 17,947
  • 26
  • 98
  • 169
84
votes
2 answers

Why is JavaFX is not included in OpenJDK 8 on Ubuntu Wily (15.10)?

I've downloaded OpenJDK 8 today via sudo apt-get install openjdk-8-jdk and it seems like JavaFX is not included in it. > java -version openjdk version "1.8.0_66-internal" OpenJDK Runtime Environment (build 1.8.0_66-internal-b17) OpenJDK Server VM…
Nikola Stojaković
  • 2,257
  • 4
  • 27
  • 49
77
votes
4 answers

JavaFX - can it really be deployed in a browser?

I have done some research on JavaFX over the last year, and even built some basic desktop apps with it. It's described as being used to create RIAs (Rich Internet Application). http://en.wikipedia.org/wiki/Javafx But can it really be deployed by a…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
76
votes
1 answer

How to find an element with an ID in JavaFX?

I have an element with the ID history type of TableView. How can I find and access this object if I have the instance of Scene scene?
Tower
  • 98,741
  • 129
  • 357
  • 507
73
votes
1 answer

Why is javafx mangling my semi-transparent cursors?

Below are two PNG images: Visually they are exactly identical - the only difference is that one has the semi-transparent background in some of the pixels (you can download the images to check it). But when I use those images as an image cursor on…
Rogach
  • 26,050
  • 21
  • 93
  • 172
72
votes
2 answers

All my JavaFX TextFields have lines in them

So, cutting my teeth on JavaFX, so far things are moving along fine. However, all of the text fields have a line running across them, 10px or so from the top. Not just in my application, but in the SceneBuilder application as well. Note, I'm not…
Will Hartung
  • 115,893
  • 19
  • 128
  • 203
71
votes
1 answer

Maven Shade JavaFX runtime components are missing

I'm trying to create a JFX11 self-containing jar using maven dependencies. From the research I've done, it seems the best way to do this is through the maven shade plugin. However, When I run it, I get the this error: Error: JavaFX runtime…
Bitclef
  • 713
  • 1
  • 7
  • 5
69
votes
11 answers

macOS - How to install Java 17

Could someone please let me know the steps to install Java on a Mac. I did brew install java I get this Warning: openjdk 17.0.1 is already installed and up-to-date. To reinstall 17.0.1, run: brew reinstall openjdk If I do java -version, I get…
RamPrakash
  • 2,218
  • 3
  • 25
  • 54
69
votes
21 answers

JavaFX Location is not set error message

I have problem when trying to close current scene and open up another scene when menuItem is selected. My main stage is coded as below: public void start(Stage primaryStage) throws Exception { primaryStage.setTitle("Shop Management"); …
user2424370
69
votes
26 answers

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 success. Can't reset all the columns because it…
user1236048
  • 5,542
  • 7
  • 50
  • 87
67
votes
2 answers

JavaFX FileChooser and DirectoryChooser

I came across a little problem now with JavaFX. I tried to make a filechoosing in my code where I can point on a FOLDER instead of a file. Currently I don't have a solution for it. Do you know a workaround (except using JFileChooser from…
newhouse
  • 1,152
  • 1
  • 10
  • 27