By octav on Feb 11, 2009
As the team is getting ready to release JavaFX 1.0 Mobile, I was experimenting with layout considerations of deploying of JavaFX applications to mobile devices.
Below are a couple of considerations for developers who will build applications for devices that have typical screen size of 320x240 pixels. The example below (inspired by Josh), draws a centered circle and uses for its radius a % of the width of the device screen size.
The other interesting point that the example illustrates is how to convert a String type into an Number. Java developers will recall using something parseInt to achieve this task (i.e. int foo = Integer.parseInt("7"). Similarly, in JavaFX you could use this technique as follows:
var myNumber:Number = Integer.parseInt("7");
Serious developers may want to read this blog by Amy Fowler that provides a lot more details on layout management in JavaFX Script.
In general, one has to cautious about calling Java libraries and should stick to the "common" JavaFX APIs. Keep in mind that javafx.ext.swing, javafx.scene.effects packages are out of bounds for mobile developers. Also the mobile emulator (bundled with NetBeans and the SDK) is not yet available for the Mac.