This Ain't Your Dad's Java! : JavaFX Blog (blogs.sun.com)
Create a Menu Bar with JavaFX (www.devx.com)
Call for Papers: Mobile and Embedded Developer Days #2 (weblogs.java.net)
After the very successful first installment of the Java Mobile & Embedded Developer Days in January of this year ... we're doing it all over again! Same format, same location, but expanded topic coverage - now including media as well...
Sun to lose lunch money on JavaFX | The Register (www.theregister.co.uk)
ongoing ? Mobility Blues (www.tbray.org)
"The big problem is this: I don't wanna be a sharecropper on Massa Steve's plantation. I don't want to write code for a platform where there's someone else who gets to decide whether I get to play and what I'm allowed to sell"
News summary: JavaFX Preview SDK, new SDN articles (weblogs.java.net)
A couple of news items have piled up over the last few days that I briefly want to bring to your attention: The JavaFX Preview SDK was announced two weeks ago. Check out the announcement on the JavaFX blog....
Way to save $$$: Mobile IM w/Java ME tech cheaper than SMS (blogs.sun.com)
![]()
Lots of developers and wireless consumers are finding out that it is cheaper to use Java ME technology for IM mobile apps on their cell phones than to use SMS text messaging on certain carriers who charge an arm and a leg. Twitter recently decided to end their SMS support in the UK because of this.
And, here's an article about how the Java ME tech-enabled MXit app in South Africa is letting mobile users communicate much better with each other (and those on PCs) than by using the more costly SMS text messaging on their mobile phones.
See:
Here's a quote:
To access MXit, the cellphone has to have Internet access, be a GPRS (general radio service) and 3G-enabled cellphone with java viewing software support.Java ME technology saves you money! I knew there was a good reason to write mobile apps in Java. :-)
- Java ME and J2ME
Motion of Ball Under Gravity - JavaFX (blogs.sun.com)
As written in the last blog, now we can use those MotionBall into giving some kind of motion. Here I have tried to give a simple motion of ball under gravity. After every hit there is an energy dissipation and the ball will slow down at end. The colors of balls, initial positions and radius are all random but under a constraint.
Now, the motion of the balls should get called in timeline. Like this:
var timeline = Timeline { repeatCount: Timeline.INDEFINITE keyFrames : [ KeyFrame { time : 16ms action: function():Void { for(ball in balls) { ball.motion(); } } } ] }Here is the final code. I tried to write the value as generic as possible but pardon me if there is some hardcoded value written somewhere :
import javafx.scene.CustomNode; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.geometry.*; import javafx.animation.Timeline; import javafx.animation.KeyFrame; import javafx.scene.paint.*; import javafx.application.Frame; import javafx.application.Stage; import javafx.scene.effect.*; // Java Legacy import java.lang.Math; import java.util.Random; import java.lang.System; var balls:GravityBall[]; var gravity:Number= 0.1; var width:Number = 1200; var height:Number= 500; var dampFactor: Number = 0.9; var timeline = Timeline { repeatCount: Timeline.INDEFINITE keyFrames : [ KeyFrame { time : 16ms action: function():Void { for(ball in balls) { ball.motion(); } } } ] } var rnd : Random = new Random(); for( i in [1..5] ) { insert GravityBall { x : rnd.nextInt( 100 ), y : rnd.nextInt( 300 ), radius : rnd.nextInt( 10 ) + 20 color : Color.rgb(rnd.nextInt(255),rnd.nextInt(255),rnd.nextInt(255)) , opacity : 0.9 } into balls; } var rect = Rectangle { x: 0, y: 500 width: 1200, height: 10 fill: LinearGradient { startX: 0.0 startY: 0.0 endX: 1.0 endY: 0.0 proportional: true stops: [ Stop { offset: 0.0 color: Color.TRANSPARENT }, Stop { offset: 1.0 color: Color.WHITESMOKE } ] } } Frame { title: "MyApplication" width: 1200 height: 732 closeAction: function() { java.lang.System.exit( 0 ); } visible: true stage: Stage { fill : Color.BLACK content: [ balls, rect ] } } timeline.start(); public class GravityBall extends CustomNode { public attribute x : Number; public attribute y : Number; public attribute radius : Number; public attribute color : Color; public attribute velocity : Number; public function motion(): Void { velocity += gravity; x += 1; y += velocity; if(x + radius > width ) { x = width - radius; //for ending at the boundary } if( y + radius > height ) { y = height - radius; velocity *= -dampFactor; } } public function create(): Node { return Circle { centerX : bind x, centerY : bind y, radius : bind radius fill: bind color }; } }This is small output view :
The Weekly RIA Round-Up for August 16 - InsideRIA (www.insideria.com)
This week brought the death of ECMAScript 4 as we know it, a preview release of YUI 3, a behind the scenes look at NBC's online olympics coverage, and did we mention ECMAScript 4 (it was worth mentioning twice)?
TableNode: Creating a Custom Scrollable Table in JavaFX | Javalobby (java.dzone.com)
NetBeans Wiki: JavaFXAndJDK6On32BitMacOS (wiki.netbeans.org)
Sun JavaFX demo and tutorals (www.flex888.com)
javafx demos.
Lucas Jordan's Blog: JavaFX and Adobe Illustrator (lucasjordan.blogspot.com)
http://javafx.com/releases/preview1/docs/api/index.html (javafx.com)
JDK 6 and JavaFX on 32-bit Macs (blogs.sun.com)
Dearest Apple. Words cannot express my feelings towards you. Therefor allow me to use punctuation and special characters: @#$%^&*!!? :-p Yours Truly.*SIGH* If you have one of the 2006 Intel Macs with 32-bit processors, you guessed what I'm talking about: In spring '08, Apple finally released the Apple JDK 6 (or as they call it, "Java for Mac OS 10.5"), but for 64-bit processors only. And there is no sign this will change soon: On Mac hardware, Mac OS X 10.5.2 and an Intel Core 2 processor are the minimum requirements for the JDK 6 -- and also for JavaFX.
Apart from switching to Windows or Linux, or buying new hardware, the only alternative for developers who don't meet those requirements is the Soy Latte JDK 6. Using this JDK solves a few problems but also raises some others. You have to decide whether the pros out-weigh the cons in your work situation:
Pro
- You can use the JavaFX SDK on top of the SoyLatte JDK
- IDEs like NetBeans work with SoyLatte (you're not stuck on the command line)
- No need to buy new hardware for JDK 6 / JavaFX development
Con
- Must use X11 whose user-interface needs getting used too (shortcuts, menus).
- Installation is less straight-forward than installing the Apple JDK
- No support for Java Web Start (javaws) yet
I tried it out at home over the weekend, and kept notes, so if you too want to set up the SoyLatte JDK and JavaFX on a 32-bit Mac, have a look at this tech tip and leave a comment what you think.
Learning Curve Journal, Part 4: Accessing a Web Service (java.sun.com)
Learning Curve Journal, Part 4: Accessing a Web Service

