Planet JFX
Advertisement

Here are several different frequently encountered problems, along with some proposed solutions.

IDE JavaFX integration[]

The IDE plugins for Netbeans and Eclipse are still in their early stages, so users may encounter several issues.

Be sure to read the note from from the mailing lists:

The current implementations of the NB 5.5 and Eclipse plugins integrate
with Java by means of Java Reflection instead of by means of the IDEs'
own Java Model. As a result, you'll need to separate your JFX code into
separate projects from your Java classes (and then make your JFX project
depend on the Java one(s)). In the future, we'll directly integrate with
the Java model(s), so that changes to Java classes will be visible to the
JFX plugins and this won't be necessary.

Eclipse[]

The eclipse plugin attempts to add the JavaFX builder to all open within the workspace. This will cause problems if you attempt to share those projects with other people who don't have the javafx plugin installed. The work arround is either to use javafx in a different workspace or to make sure the projects ".project" file is read only (or in source control) preventing write access from the file.

The plugin is far from perfect and has difficulty loading java files from both the same project and from other projects (see https://openjfx.dev.java.net/issues/show_bug.cgi?id=7).

(Moved posted question to Talk page.)

MouseEvent issues[]

Some components may appear to eat MouseEvents, preventing the effects you desire. Again, a posting from the list may help resolve this:

Try:
 View {
       selectable: false
       ...
 }
to cause it to ignore mouse events

What happened to ImagePanel?[]

This forum posting describes that there is no image panel any more, and discusses some binding issues:

Sorry, no it doesn't exist anymore - that's a doc bug. You can just use a
SimpleLabel or Label.

To make the binding work you can do this:

SimpleLabel {
   icon: bind select Image {url: u} from u in model.selectedImageUrl
}

SimpleLabel has bug such that it doesn't update the icon when the image url

changes. The above works around that.

You could also do it this way:

SimpleLabel {
   text: bind "<html><img src='{model.selectedImageUrl}'></img></html>"
}

How do I reference a JFX script from inside a JFX script?[]

See Referencing other JavaFX files

Why don't the demos look right on OS X?[]

It seems like this is a problem for Java 1.5 on OSX. Try upgrading to a 1.6 developer release, but this still doesn't fix everything, apparently. See this thread for a brief discussion.

Advertisement