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
32
votes
8 answers

How to use JavaFX 2 SDK in Eclipse?

I have installed JavaFX 2.0 SDK and now I would like to do an JavaFX application with Eclipse. But how can I use the javafx.* classes in Eclipse? The official JavaFX Eclipse plugin seem to be for JavaFx 1.2 and outdated. When I try to install…
Jonas
  • 121,568
  • 97
  • 310
  • 388
32
votes
1 answer

JavaFX: Undecorated Window

I am attempting to make a Windows PC Toast notification. Right now I am using a mixture of Swing and JavaFX because I did not find a way to make an undecorated window with FX. I would much prefer to only use JavaFX. So, how can I make an undecorated…
Dorothy
  • 2,842
  • 10
  • 33
  • 46
32
votes
3 answers

JavaFX scene builder 2: controller class

Hi im building a JavaFX project and am using JavaFX Scene Builder 2. I wanted to link my controller to my fxml file but i can't see the possibility to add a controller to my fxml file in Scene Builder 2. I was wondering if someone could help me out.…
jan behang
  • 535
  • 1
  • 4
  • 12
32
votes
6 answers

How can I open the default system browser from a java fx application?

I'm trying to open a web url in the default system browser from javafx. I didn't find any official documentation regard this. Any clue? EDIT: I've found a tutorial but it doesn't work. I'm using MacOsX and I tried launching…
Advanced
  • 1,457
  • 2
  • 13
  • 12
31
votes
11 answers

How do you get JavaFX ListView to be the height of its items?

If I create a ListView: new ListView<>(FXCollections.observableArrayList("1", "2", "3")) I would expect it to create a ListView with 3 rows. But it doesn't. It creates a ListView of 17 or so rows. Is there a way to tell ListView to always be the…
mentics
  • 6,852
  • 5
  • 39
  • 93
31
votes
2 answers

How do I add margin to a JavaFX element using CSS?

I have the following fragment of FXML:
vbezhenar
  • 11,148
  • 9
  • 49
  • 63
31
votes
3 answers

Styling a JavaFX 2 button using FXML only - How to add an image to a button?

I want to change the styling of a button, most of the threads here and the articles on the internet show how to do it using Java code, which I don't see it as a real good solution, is there any way for example to set a button with some text and an…
AymenDaoudi
  • 7,811
  • 9
  • 52
  • 84
30
votes
4 answers

How to create multiple javafx controllers with different fxml files?

I've been looking at some blogs and other stackoverflow questions, and I'm not seeing a direct answer to my question. I am creating a javafx gui client and I want to have my menubar be one controller in one fxml and then i want the content area to…
j will
  • 3,747
  • 11
  • 41
  • 64
30
votes
4 answers

JavaFX: "Toolkit" not initialized when trying to play an mp3 file through MediaPlayer class

I'm trying to make a simple mp3 play in the background of my program using the following: Media med = new Media(getClass().getResource("intro.mp3").toExternalForm()); MediaPlayer mPlayer = new MediaPlayer(med); mPlayer.play(); The intro.mp3 file is…
Dimitris Sfounis
  • 2,400
  • 4
  • 31
  • 46
30
votes
5 answers

JavaFX Hide ScrollPane gray border

Is there any way of hiding the gray border of an ScrollPane control in JavaFX ?
nailujed
  • 1,169
  • 5
  • 17
  • 23
30
votes
2 answers

JavaFX HBox hide item

How can i hide an item in HBox, and made space used by this item available to other items. TitledPane legendPane = new TitledPane("Legend", _legend); legendPane.setVisible(false); LineChart chart = new LineChart(_xAxis,…
José
  • 3,041
  • 8
  • 37
  • 58
29
votes
1 answer

JavaFX primaryStage remove windows borders?

I am making JavaFX destop application. I want to remove the default windows border and also I want to customize the 3 standard icons of minimize , maximize and close. The original motivation of this kind of looks or customization is new Kaspersky…
Dhruv
  • 10,291
  • 18
  • 77
  • 126
29
votes
6 answers

JavaFX: FXML: How to make the child to extend its size to fit the parent pane?

I have managed to load a child fxml(sub UI) under a parent fxml (mainMenu UI). I have created an AnchorPane with id "mainContent". This pane is bound to 4 sides and changes in accords to the stage. The child window will be loaded into the…
Dean Chiu
  • 1,325
  • 1
  • 13
  • 13
29
votes
2 answers

Multiple FXML with Controllers, share object

Goodevening everyone, I have found a bunch of posts already on this topic but I still can not manage to pass an object from Controller1 to Controller2. Is there somewhere a full tutorial or some example project that does this? I've gotten this far…
Perneel
  • 3,317
  • 7
  • 45
  • 66
28
votes
3 answers

JavaFX 2 as a Maven dependency

Is it possible to reference JavaFX 2.0 as a dependency in Maven in the pom.xml so that everything works smoothly? I saw in this question that it is possible to install the jfxrt.jar locally, but ideally I'd like a simpler approach where the…
mikera
  • 105,238
  • 25
  • 256
  • 415