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

JavaFX & FXML: how do I set the default selected item in a ChoiceBox in FXML?

I have the following FXML:
tadasajon
  • 14,276
  • 29
  • 92
  • 144
17
votes
7 answers

How to unmask a JavaFX PasswordField or properly mask a TextField?

In a UI of mine, I have a PasswordField like so (urm the one at the bottom!): I want a user to be able to check the checkbox you see in the picture and have all "secret" password characters displayed. Not much different from the option we get from…
Martin Andersson
  • 18,072
  • 9
  • 87
  • 115
17
votes
2 answers

java.lang.IllegalArgumentException: Invalid URL or resource not found

I tested this code: public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage primaryStage) { // Image Image image = new Image("za.png"); ImageView…
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
17
votes
3 answers

JavaFX fullscreen - resizing elements based upon screen size

Is there any way to make fullscreen(and if possible resizing too) to instead of rearranging everything (actually what it does is to rearrange the elements like resizing but to the whole screen) to make an actual fullscreen mode? (like games that…
user1090694
  • 609
  • 4
  • 8
  • 16
17
votes
4 answers

how to stop "JavaFX Application Thread"

I have a simple console application which sometimes need to perform graphics operations, for those I'm using JavaFx framework (there are some functions that I need like the css styling for text ) I simply generate some shapes and text into an…
Francesco
  • 317
  • 1
  • 4
  • 13
17
votes
3 answers

JavaFX launch another application

I've been smashing my head with JavaFx... This works for when there's no instances of an application running: public class Runner { public static void main(String[] args) { anotherApp app = new anotherApp(); new…
link_boy
  • 1,025
  • 4
  • 12
  • 23
17
votes
5 answers

JavaFX - Get GridPane to fit parent

I have a simple GridPane showing a couple of labels and a button, but I cannot seem to get it to fit the parent StackPane. How would I go forth and make it so that it fills whatever container it is in? GridPane g = new GridPane(); g.add(new…
John Mikael Gundersen
  • 714
  • 1
  • 10
  • 25
17
votes
3 answers

Reducing size of JRE in JavaFx bundle

I created a JavaFX application, For it I bundled it As a self-contained standalone application, using a private copy of Java Runtime. But this became my application's size of 166MB, in which 146 Mb size is for jre. How can I reduce the size of my…
Ronak Jain
  • 2,402
  • 2
  • 24
  • 38
17
votes
4 answers

Converting Integer to ObservableValue in javafx

How to convert Integer To ObservableValue in javafx 2.0 and later ?
ItachiUchiha
  • 36,135
  • 10
  • 122
  • 176
17
votes
2 answers

javafx 2 and css pseudo-classes: setting hover attributes in setStyle method

I have a simple Scene with this code: scene.getStylesheets().add("packagename/testcss.css"); And my testcss.css is: .button { -fx-background-color: #DDFFA4; } .button:hover { -fx-background-color: #9ACD32; } What i achieve is the nice…
AgostinoX
  • 7,477
  • 20
  • 77
  • 137
17
votes
2 answers

JavaFX HTML styling (or equivalent) labels

In Swing, it was trivially easy to style a JLabel using HTML - you simply used the HTML you wanted as the text for the label, and it was rendered appropriately. In JavaFX this isn't available, but we can set the style of a particular label (or node…
Michael Berry
  • 70,193
  • 21
  • 157
  • 216
17
votes
1 answer

Javafx Pane vs Region?

According to the documentation, both Region and Pane will resize any resizable child nodes to their preferred size, but will not reposition them. So i can't see where the differencies between these two containers remain and when use one or another.
QuidNovi
  • 609
  • 6
  • 20
16
votes
4 answers

How to organize controllers/presenters in a large JavaFx 2.0 application?

For a project I've been working on a JavaFX 2.0 desktop application (a keytool UI). The way JavaFx2.0 works (in my project anyways), the UI event handling takes place in the JavaFX 2.0 UI classes itself (for example: onclicked() events or property…
Jop
  • 243
  • 2
  • 9
16
votes
7 answers

How to make canvas Resizable in javaFX?

In javaFX to resize a canvas there is no such method to do that, the only solution is to extends from Canvas. class ResizableCanvas extends Canvas { public ResizableCanvas() { // Redraw canvas when size changes. …
HinoHara
  • 572
  • 3
  • 13
  • 24
16
votes
2 answers

How to open another window in JavaFX 2?

I have made a simple JavaFX application, but I would like the main window to open a secondary window when the user clicks a button. What would be the simplest way to accomplish this?
user1648411