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
23
votes
1 answer

JavaFX equivalent of Swing's pack()

I want to resize a window to fit the contents of the window. In Swing there is the pack() method. Is there a similar method to do this in JavaFX? What I am trying to do is to create a confirmation dialog. When I create the dialog, it is wider than…
ceklock
  • 6,143
  • 10
  • 56
  • 78
23
votes
4 answers

Displaying changing values in JavaFx Label

In JavaFX, how can I display values which continuously change with time using "label" ?
Surjit
  • 345
  • 1
  • 5
  • 13
23
votes
1 answer

How to implement a transparent Pane with non-transparent children?

How can i implement a transparent panel with non-transparent children in JavaFX 2? The effect i want to achieve is for example applied to menus in Blender: The menu-panel / window is transparent, but the text items are not transparent which leads…
dajood
  • 3,758
  • 9
  • 46
  • 68
23
votes
2 answers

How to use the return value of call method of Task class in Javafx

I am using Task class to run background task in javafx application to fetch the data from the database. public class CustomTask extends Task> { TableView tableview; ObservableList data; …
Deepak Goel
  • 5,624
  • 6
  • 39
  • 53
22
votes
3 answers

How to make JavaFX 2.0 ChoiceBox to select its first element

When I create a JavaFX 2.0 ChoiceBox instance like this: final ChoiceBox fontChBox = new ChoiceBox<>(FXCollections.observableArrayList("First", "Second", "Third")); a choice box is displayed with no selection. I would like to select the…
jilt3d
  • 3,864
  • 8
  • 34
  • 41
22
votes
4 answers

Set caret position in javafx.scene.control.TextArea and javafx.scene.control.TextField

I need to set the caret position manually in my code. There is a getCaretPosition() under javafx.scene.control.TextInputControl but there is no setter method. How can I set the caret position?
Anuruddha
  • 1,367
  • 6
  • 19
  • 38
22
votes
4 answers

How to create a popup window in javafx

I want to create a popup window in a JavaFX application. Give me some ideas. When I click on Check button it opens the popup window. How to do it?
Maulik Patel
  • 2,742
  • 4
  • 19
  • 28
22
votes
2 answers

JavaFX: Focusing textfield programmatically

I wrote an application with JavaFX which will only be usable with keyboard's arrows. So I prevented MouseEvent on Scene's stage, and I "listen" to KeyEvents. I also switched off focusability of all nodes : for(Node n : children) { …
PacDroid
  • 541
  • 1
  • 7
  • 22
22
votes
4 answers

Set Font globally in JavaFX

How can I set the Font type globally in a JavaFX application? Is there any solution that I can use? In JavaFX 8 the default Font has changed, and I would like to use the same Font used in JavaFX 2.2.
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
22
votes
3 answers

Is JavaFX complete replacement of Swing?

I had a Java Desktop Application in which graphical user interface had designed in swing. After we came to know that JavaFX replacing Swing We have replaced graphical user interface with JavaFX. "6. Is JavaFX replacing Swing as the new client UI…
Ashish Pancholi
  • 4,569
  • 13
  • 50
  • 88
22
votes
1 answer

Checking Collision of Shapes with JavaFX

I am trying to do some collision detection. For this test I am using simple rectangular Shape, and checking their Bound, to figure if they are colliding. Although the detection does not work as expected. I have tried using different ways to move the…
Giannis
  • 5,286
  • 15
  • 58
  • 113
22
votes
3 answers

Setting stylesheets declaratively in FXML

In HTML we are used to niceties of being able to set stylesheets programmatically like But the examples of setting stylesheets I found for JavaFX require setting stylesheets programmatically,…
Chui Tey
  • 5,436
  • 2
  • 35
  • 44
22
votes
2 answers

Add WebView control on Swing JFrame

I am working on Swing application mixed with JavaFX control. I have created a JavaFX control (WebView) to browse HTML files. But I want to know, how can I add this web view control on the container of a Swing JFrame?
adesh
  • 1,157
  • 3
  • 18
  • 28
22
votes
3 answers

Getting selected element from ListView

I modify a ListView with the results from a database search in order to use that selection to make another DB request later on. I want to get the field value of that ListView. What method can I use for that? I just thought I can also add an event to…
Dynelight
  • 2,072
  • 4
  • 25
  • 50
22
votes
3 answers

Combo-box key value pair in JavaFX 2

I am just starting to learn JavaFX 2. Now I am trying to build a sample application. Then I got stuck in combobox. I did not find any reference to key value pair for combobox in JavaFX. The combobox javadoc at…
Shrestha
  • 385
  • 1
  • 2
  • 11