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
18
votes
2 answers

JavaFX entirely customized windows?

I would like to have an application where I've entirely customized the window's appearance. So far I've learned that I can remove the typical window stuff with: class Application extends javafx.application.Application { /** * Starts the…
Tower
  • 98,741
  • 129
  • 357
  • 507
18
votes
7 answers

RequestFocus in TextField doesn't work

I use JavaFX 2.1 and I created GUI using FXML, in the controller of this GUI I added myTextField.requestFocus();. But I always get the focus in the other control.
Adil
  • 4,503
  • 10
  • 46
  • 63
18
votes
1 answer

How to perform an action by selecting an item from ListView in JavaFX 2

I would like to have an action performed when I select an item from my listview in javafx 2. I use a Netbeans JavaFX fxml application and SceneBuilder. The OnMouseClicked method in SceneBuilder did not work. It gave me back an error that it can't…
ayu_trance
  • 185
  • 1
  • 2
  • 6
18
votes
1 answer

JavaFx 2.x - Swing : Not on FX application thread

I am trying to use JavaFx 2.x and Swing application by using a JInternalFrame in which attach a JFXPanel My code below public class InternalFrameWithJavafx extends javax.swing.JFrame { /** * Creates new form InternalFrameWithJavafx */ public…
Alberto acepsut
  • 1,972
  • 10
  • 41
  • 87
18
votes
3 answers

How to reference primaryStage

I use .fxml-Files for the view-layer of my application. Each fxml has a controller attached to it Let's assume I have a mainFrame and it's controller. The mainFrame.fxml is…
Gundon
  • 2,081
  • 6
  • 28
  • 46
18
votes
3 answers

How to listen for resize events in JavaFX

How can I detect when a Scene or Stage changes size in JavaFX 2.1? I cannot find any EventHandler for this.
Kretep
  • 514
  • 2
  • 4
  • 12
18
votes
3 answers

How to bind stage resizing with resizing of components?

I have a JavaFX 2.0 application with FXML. I want the components (TextFields, ComboBoxes, layouts, and so on) to be resized when a window with an application is resized. So... As it is written on Oracle documentation for JavaFX, to make something…
Victoria Agafonova
  • 2,048
  • 10
  • 33
  • 50
18
votes
1 answer

Cannot get border to differ from side-to-side or up-and-down in TableCell javafx 2

I am trying to create a schedule interface within javafx 2+, and I am having trouble getting the TableView to contain TableCells that look like conjoined components. The first thing that I tried was to use background colors and borders, however, I…
user1352550
  • 181
  • 1
  • 1
  • 3
17
votes
3 answers

How can I implement the functionality of awt.CardLayout in my javaFX 2.0 application?

In my javaFX 2.0 app, I need to replace a component which is used awt.CardLayout. Cardlayout has a functionality as a stack which displays the top component in stack. And also we can manually configure which is to be displayed. In javaFX 2.0, there…
Anuruddha
  • 1,367
  • 6
  • 19
  • 38
17
votes
3 answers

How to load fxml file inside Pane?

If we have a Stage then Scene includes 2 Panes the 1st Pane contains Button and the 2nd Pane is empty could we load other fxml file inside this 2nd Pane? fxml1: VBox |_Pane1-->Button |_Pane2 /////////////// fxml2:…
Hussein Ahmed
  • 730
  • 2
  • 7
  • 17
17
votes
3 answers

Can not build native bundle for JavaFX application on WinXP 32-bit

I am trying to build a JavaFX application (native bundle) for WinXP 32-bit systems. I have deployed a WinXP 32-bit Virtual Machine. Have also installed JDK (jdk-8u65-windows-i586) and InnoSetup and Netbeans 8.0.2 ... However while i am trying to…
thanili
  • 777
  • 4
  • 26
  • 57
17
votes
2 answers

How to center a node within a pane javafx

How do I create a Pane and have a child Node put at the center? Lets say the Pane is 500 by 500 and the Node is an ImageView with a 200 by 200 Image ImageView view = new ImageView(); Image img = new Image("test.png"); view.setImage(img); Pane pane…
darewreck
  • 2,576
  • 5
  • 42
  • 67
17
votes
3 answers

How to disable Button when TextField is empty?

In the following code I have a TextField and a Button. I need to disable the Button when ever the TextField is empty, so that I can avoid entering empty values to the database. How can I make the button disabled ? private VBox addVBox() { …
TomJ
  • 1,803
  • 14
  • 37
  • 57
17
votes
1 answer

How to change the color of pane in javafx?

I want to change the color of a Pane which I get as a String from user. How can I set this String as a background color in my pane? Code: colorField.setOnKeyTyped(new EventHandler() { @Override public void handle(KeyEvent t) { …
maryam
  • 387
  • 2
  • 3
  • 10
17
votes
3 answers

How do I get the close event of a stage in JavaFX?

In JavaFX, how can I get the event if a user clicks the Close Button(X) (right most top cross) a stage? I want my application to print a debug message when the window is closed. (System.out.println("Application Close by click to Close…
java baba
  • 2,199
  • 13
  • 33
  • 45