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

How perform task on JavaFX TextField at onfocus and outfocus?

I am working on JavaFX project. I need to perform some task on a JavaFX TextField. For example on the "on focus" event for the TextField I want to print System.out.println("Textfield on focus"); and on the "out focus" event it should…
java baba
  • 2,199
  • 13
  • 33
  • 45
62
votes
11 answers

Javafx 2 click and double click

I would like to know if it was possible to detect the double-click in JavaFX 2 ? and how ? I would like to make different event between a click and a double click. Thanks
Delkaspo
  • 768
  • 1
  • 6
  • 10
60
votes
5 answers

JavaFX TabPane: How to set the selected tab

I have a Java Desktop Application with JavaFX 2 in it and in my FX I've got a TabPane. I want to set the default tab. In other words I want to set a tab as selected. I found that there are multiple ways to find out which tab is selected and I found…
Dorothy
  • 2,842
  • 10
  • 33
  • 46
58
votes
11 answers

AutoComplete ComboBox in JavaFX

I'm looking for a way to add autocomplete to a JavaFX ComboBox. This AutoFillBox is known but not what I'm searching. What I want is a editable ComboBox, and while typing the list should filtered. But I want also to open the list without typing and…
JulianG
  • 1,551
  • 1
  • 19
  • 29
51
votes
3 answers

JavaFX open new window

Looking at this code they show a way to display a new window after a login. When username and password are correct it opens new dialog. I want a button click to open new dialog, without checking for username and password.
MehmanBashirov
  • 641
  • 1
  • 7
  • 15
50
votes
5 answers

Adding space between buttons in VBox

I have a collection of buttons: VBox menuButtons = new VBox(); menuButtons.getChildren().addAll(addButton, editButton, exitButton); I want to add some spacing between these buttons, without using a CSS style sheet. I think there should be a way to…
codepleb
  • 10,086
  • 14
  • 69
  • 111
50
votes
7 answers

JavaFX 2 Automatic Column Width

I have a JavaFX 2 table that is displaying contact details for people, lets imagine there are three columns: first name, last name and email address. When my application starts it populates the table with several rows of data about the people…
wobblycogs
  • 4,083
  • 7
  • 37
  • 48
49
votes
6 answers

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 StackPane automatically with the AnchorPane. Thus;…
Korki Korkig
  • 2,736
  • 9
  • 34
  • 51
47
votes
4 answers

JavaFX How to set scene background image

How can I set the background image of a scene?
John
  • 1,699
  • 5
  • 20
  • 29
46
votes
14 answers

Auto fit size column in table view

The TableView in JavaFX have 2 column resize policies: CONSTRAINED_RESIZE_POLICY and UNCONSTRAINED_RESIZE_POLICY But I want columns that are resized to fit the content of theirs cells. How do I do this?
yelliver
  • 5,648
  • 5
  • 34
  • 65
44
votes
4 answers

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 instances of this custom component. UPDATE: see my…
Andrey
  • 8,882
  • 10
  • 58
  • 82
44
votes
5 answers

How to set a JavaFX Stage/Frame to Maximized

I'm using JavaFX 2. I want my frame to open maximized but I'm not seeing a way. I searched a bit on the internet without success. For the stage I see setFullScreen() and setIconified() but I don't see anything like setMaximized().
Dorothy
  • 2,842
  • 10
  • 33
  • 46
44
votes
5 answers

Control for displaying multiline text?

I need to display a multiline, read-only text - which control can be used for that? It should only display the text, like a Label does, however Label does not support multiline? Thanks for any hint :-)
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
44
votes
2 answers

Setting a cookie using JavaFX's WebEngine/WebView

I cannot seem to find any way to set a cookie programatically using WebEngine / WebView in JavaFX. The API doesn't give any idea as to how to obtain an HttpRequest-like object to modify the headers (which is what I use in the app for XML-RPC), or…
Dreen
  • 6,976
  • 11
  • 47
  • 69
43
votes
4 answers

Make portion of a text bold in a JavaFx Label or Text

In my JavaFx application I need to have a word or two rendered in boldface in the whole sentence. Currently the sentence is rendered as a JavaFx Label but upgrading component also would not allow me set the text as so that I can have the words…
Neil
  • 5,919
  • 15
  • 58
  • 85