Home » JavaFX » Page 17

Tag Archives: JavaFX

PopupMenu in JavaFX 2

Creating Popup Menus To create a Popupmenu in JavaFX you can use the ContextMenu class. You add MenuItems to it and can also create visual separators using SeparatorMenuItem. In the example below I’ve opted to subclass ContextMenu and add the MenuItems on its constructor. public class AnimationPopupMenu extends ContextMenu{ public AnimationPopupMenu() { (...) getItems().addAll( MenuItemBuilder.create() .text(ADD_PARTICLE) .graphic(createIcon(...)) .onAction(new EventHandler() { ...

Read More »

Book Review: JavaFX 2.0: Introduction by Example

Although Oracle’s changes to JavaFX at JavaOne 2010 and JavaOne 2011 have converted me from a skeptic to a believer when it comes to JavaFX, the shift in JavaFX vision has not been without its downsides. In particular, the JavaFX book market has been tricky because nearly all available JavaFX books have been about version 1.x. In this post, I ...

Read More »

Integrating JavaFX 2.0 with Swing and SWT

One of the improvements in JavaFX with JavaFX 2.0 has been greater ease of interoperability with Swing and SWT. Several online resources document how this is done. These include Integrating JavaFX into Swing Applications and SWT Interop. However, in a nice example of effective class-level Javadoc documentation, the respective JavaFX classes javafx.embed.swing.JFXPanel and javafx.embed.swt.FXCanvas each provide a simple code sample ...

Read More »

What I Learnt about JavaFX Today

In case you haven’t heard, JavaFX 2 is the new Desktop / web / client framework for Java. It’s had a considerable overhaul since JavaFX 1 (which was frankly not that impressive). Out has gone the custom scripting language, and instead you can write it using standard Java and an XML-based language for the actual UI presentation. So today, a ...

Read More »

Migrating from JavaFX 1.3 to JavaFX 2.0

Some days ago I finished migrating the source code of Modellus from JavaFX 1.3 script to JavaFX 2.0 java language. So I thought it would be nice to write about what I’ve learned in the process. I’d like to point out that if you want to keep using JavaFX script in JavaFX 2.0 you can use Visage: http://code.google.com/p/visage/ CustomNode class ...

Read More »

JavaOne is Rebuilding Momentum

Just finished up an extremely busy week at JavaOne and there was a lot to like about this year’s event. There were plenty of surprise announcements, lots of good content/sessions, and a lot of improvements on the venue and organization. For folks who have been patiently waiting for me to publish all my talks, I apologize for the delay… giving ...

Read More »

JavaFX 2.0 beta sample application and after thoughts

I had quite sometime back played around with JavaFX and had good and bad experiences using the language. With the JavaFX 2.0 beta being released I thought of giving it a try. Here, I developed a simple Geocoding application which will take the address and provides the latitude-longitude values for that location – using Google Geocoding API. I used Groovy ...

Read More »