Converting iPhone to JavaFX Mobile
|
|
Yep, I'm finding using the newly launched JavaFX Mobile to be a lot of fun. Here's an example of taking the iPhone GUI and converting it to JavaFX Mobile. Try out the JavaFX Mobile app in this blog post. You should see it start up to the left. Try clicking on one of the icons to see the iPhone icons bouncing.
|
*NOTE: On initial launch, you may see 2 dialog boxes. Accept both: "This applet was signed by 'JavaFX...'" Click: "Trust". "JavaFX delivers rich media and content..." Click: "Accept".
|
Partial source code:
var camImage = ImageView {
translateX: bind width * .77
translateY: bind bounceAnimY;
image: Image { url: "{__DIR__}image/iphone-cam.png"
}
onMousePressed: function(e:MouseEvent) {
bounceAnim.time = 0s;
bounceAnim.play();
}
onMouseEntered: function(me:MouseEvent) {
bounceButton.selected = true;
}
onMouseExited: function(me:MouseEvent) {
bounceButton.selected = false;
}
};
// this function is called to reinitialize the values when the height changes
function createAnims() {
springAnimY = height - 100;
springAnim = Timeline {
keyFrames: [
at(1s) { springAnimY => 50 }
at(2.5s) { springAnimY =>
height - 100.0 tween spring}
]
};
bounceAnimY = height - 100;
bounceAnim = Timeline {
keyFrames: [
at(1s) { bounceAnimY => 50 }
at(2.5s) { bounceAnimY =>
height - 100.0 tween bounce}
]
};
}
|
Theme originally based on design by Bryan Bell








