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
43
votes
3 answers

How to create a modal window in JavaFX 2.1

I can't figure out how to create a modal window in JavaFX. Basically I have file chooser and I want to ask the user a question when they select a file. I need this information in order to parse the file, so the execution needs to wait for the…
lucaconlaq
  • 1,511
  • 4
  • 19
  • 36
42
votes
9 answers

How to remove JavaFX stage buttons (minimize, maximize, close)

How to remove JavaFX stage buttons (minimize, maximize, close)? Can't find any according Stage methods, so should I use style for the stage? It's necessary for implementing Dialog windows like Error, Warning, Info.
Anton
  • 1,903
  • 3
  • 16
  • 18
42
votes
2 answers

Updating UI from different threads in JavaFX

I am developing an application with several TextField objects that need to be updated to reflect changes in associated back-end properties. The TextFields are not editable, only the back-end may change their content. As I understand, the correct way…
eddy
  • 643
  • 1
  • 6
  • 10
42
votes
6 answers

GroupBox / TitledBorder in JavaFX 2?

Is there something like a GroupBox or TitledBorder available on JavaFX 2? Thanks for any hint :-)
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
42
votes
3 answers

How to get the version number of JavaFX?

How can I find out at runtime which version of JavaFX I'm using?
dajood
  • 3,758
  • 9
  • 46
  • 68
41
votes
6 answers

Resizing images to fit the parent node

How do I get an image in an ImageView to automatically resize such that it always fits the parent node? Here is a small code example: @Override public void start(Stage stage) throws Exception { BorderPane pane = new BorderPane(); ImageView…
rbs
  • 1,087
  • 2
  • 17
  • 24
40
votes
3 answers

JavaFX FileChooser: how to set file filters?

I want to set file filters in a JavaFX FileChooser but I could not find a way to do it. My code: FileChooser fc = new FileChooser(); fc.setTitle("My File Chooser"); File f = fc.showOpenDialog(primaryStage); System.out.println(f);
ceklock
  • 6,143
  • 10
  • 56
  • 78
38
votes
13 answers

How to add CheckBox's to a TableView in JavaFX

In my Java Desktop Application I have a TableView in which I want to have a column with CheckBoxes. I did find where this has been done http://www.jonathangiles.net/javafx/2.0/CellFactories/ but as the download is not available and because I don't…
Dorothy
  • 2,842
  • 10
  • 33
  • 46
36
votes
2 answers

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 attributes evety tag has? which values evety…
Victoria Agafonova
  • 2,048
  • 10
  • 33
  • 50
36
votes
1 answer

Task vs Service for database operations

What is the difference between JavaFX 8 Task and Service and in which case is it better to use one over the other? What is better to use in database operations?
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
36
votes
2 answers

Update JavaFX UI from another thread

I have a JavaFX application, and a worker thread, implemented via javafx.concurrent.Task, that performs a long process, that is zipping and uploading a set of files. I've connected the task progress to a progress bar via progressProperty. In…
AgostinoX
  • 7,477
  • 20
  • 77
  • 137
35
votes
4 answers

How to calculate the pixel width of a String in JavaFX?

It appears that there is no API call to calculate the width (in pixels) of a text string in Java FX 2.2. There have been suggestions of workarounds on other forums, but my efforts to create or find any code that returns the width of a String,…
Don Wills
  • 393
  • 1
  • 3
  • 6
33
votes
6 answers

Programmatically change the TableView row appearance

After doing a Oracle tutorial about the TableView, I was wondering if there's a way to programmatically apply different CSS style to the selected TableView row. For example, user selects a certain row, clicks the "Highlight" button and the selected…
E. Normous
  • 543
  • 2
  • 7
  • 14
33
votes
7 answers

JavaFX: Update of ListView if an element of ObservableList changes

I would like to display a list of persons (coded in POJOS, and containing a name and surname property) using a JavaFX ListView control. I created the ListView and added the list of persons as an ObservableList. Everything works fine if I delete or…
user1828169
  • 331
  • 1
  • 3
  • 4
33
votes
6 answers

How do I pick up the Enter Key being pressed in JavaFX2?

I have a TextField to enter a search term, and a button for "Go". But in JavaFX2, how would I make it so pressing the Enter Key in the TextField would perform an action? Thanks :)
Geesh_SO
  • 2,156
  • 5
  • 31
  • 58