Questions tagged [javafx-2]

OUTDATED - DO NOT USE FOR GENERAL JAVAFX QUESTIONS! JavaFX 2 provides a Java-based UI platform for creating standalone or browser-based Rich Client Applications. Its Java API enables Java developers to leverage existing skills and tools. The next version - JavaFX-8 was released March 18, 2014.

Useful resources:

JavaFX links :

Testing JavaFX-2 applications :

OpenJavaFX links :

JavaFX Scene Builder links :

Blogs and news sites about JavaFX :

Projects, complementing and extending basic functionality of JavaFX :

Books about JavaFX 2 :

Personal blogs, by people, who write about JavaFX :

Use javafx-8 tag for questions, related to javafx-8 (or javafx-3 - previous name), which will be released as part of JDK-8 - the sequel of javafx-2.

4858 questions
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
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
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
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
92
votes
3 answers

JavaFX 2 and Internationalization

I've just started writing my first JavaFX 2 application after learning the basics and would like to internationalize it. I notice that in JavaFX 1.x, the scripting language allowed for very simple internationalization of strings. Are there any…
wobblycogs
  • 4,083
  • 7
  • 37
  • 48
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
83
votes
13 answers

How to attach source or JavaDoc in eclipse for any jar file e.g. JavaFX?

Presently I'm working with JavaFX. Whenever I hover over a method of JavaFX its gives me the following error: 'Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found' How should I resolve this? How…
Dhruv
  • 10,291
  • 18
  • 77
  • 126
83
votes
10 answers

How to create and show common dialog (Error, Warning, Confirmation) in JavaFX 2.0?

How do I create and show common dialogs (Error, Warning, Confirmation) in JavaFX 2.0? I can't find any "standard" classes like Dialog, DialogBox, Message or something.
Anton
  • 1,903
  • 3
  • 16
  • 18
80
votes
4 answers

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 it. Static functions could be a way, but they don't…
betaman
  • 1,865
  • 5
  • 25
  • 30
68
votes
8 answers

JavaFX 2.1: Toolkit not initialized

My application is Swing-based. I would like to introduce JavaFX and configure it to render a Scene on a secondary display. I could use a JFrame to hold a JFXPanel which could hold a JFXPanel but I would like to achieve this with JavaFX…
Dan Vulpe
  • 1,316
  • 1
  • 11
  • 13
66
votes
7 answers

How to avoid Not on FX application thread; currentThread = JavaFX Application Thread error?

Below code snippets is giving me error Not on FX application thread; currentThread=JavaFX Application Thread.This application was working fine in java 1.7 but when i moved it to fx8 it is now giving error. when I start the application on my 1st…
Rajesh Kumar Dash
  • 2,203
  • 6
  • 28
  • 57
64
votes
19 answers

JavaFX "Location is required." even though it is in the same package

I am trying to get my JavaFX program to run but am having some difficulty. I keep getting an error of 'java.lang.NullPointerException: Location is required.' The fxml file is in the same package as Application class. Here is my very simple…
Gremash
  • 8,158
  • 6
  • 30
  • 44
62
votes
3 answers

Why am I getting java.lang.IllegalStateException "Not on FX application thread" on JavaFX?

I have an application that has a TableView that has an attached listener so it refreshes as soon as it detects a change, but the thing is that I´m getting java.lang.IllegalStateException: Not on FX application thread; currentThread = Smack Listener…
linker85
  • 1,601
  • 5
  • 26
  • 44
1
2 3
99 100