« Previous day (Apr 8, 2008) | Main | Next day (Apr 10, 2008) »
 20080409 Wednesday April 09, 2008

JavaFX Script Player running on a Java ME cell phone

I've been working with Misha Krivoruchko, Jan Sterba, Igor Karpov, Oleg Pliss, Peter Kim, and the rest of the team led by Richard Gregor on the JavaFX Script Player project and on running cell phone demos for the upcoming JavaOne conference. Jan got the first demo running on his device in Prague this morning. I spent some time getting it to run on the cell phone we have in California. I finally had success and was able run this demo of JavaFX Script running on a Pantech Duo C810.

See:

Success: Running JavaFX on a Java ME cell phone

Yeah, I know. It doesn't look like much, but when you realize it's JavaFX script running on Java ME it makes you think about the possibilities... :-)




Some fun JavaFX Script code for FancyGraphics:
import javafx.gui.*;

// This version of the class relies on the Reprise APIs

Canvas {
   content: [
       Rectangle {
           x: 10
           y: 10
           width: 100
           height: 100
           /* fill: LinearGradient {
               stops: [
                   Stop {offset: 0.0, color: Color {red: 0.0 green: 0.5 blue: 1.0}},
                   Stop {offset: 0.5, color: Color {red: 0.4 green: 0.1 blue: 0.4}},
                   Stop {offset: 1.0, color: Color {red: 0.6 green: 0.4 blue: 0.2}}
               ]
           } */
       },
       Circle {
           centerX: 150
           centerY: 150
           radius: 20
       },
       Line {
           opacity: 0.5
           x1: 100
           y1: 100
           x2: 200
           y2: 200
           fill: Color {red:0.6 green: 0.6 blue: 0.6}
           strokeWidth: 10
           stroke: Color {red: 0.8 green: 0.8 blue: 0.8}
           strokeDashArray: [10.0,20.0,30,40,50,60]
       },
       Text {
           font: Font {
            name: "Courier"
            size: 20
           }
           x: 50
           y: 50
           content: "Hello, FX!"
           fill: Color {red: 0.8 green: 0.4 blue: 0.4}
           stroke: Color {red:0.9 green: 0.2 blue: 0.2}
           strokeLineJoin: StrokeLineJoin.MITER
           strokeLineCap: StrokeLineCap.ROUND
       },
Path {
           transform: Translate {x: 120 y:160 }
           elements: [
               MoveTo {x:-30 y:-70},
               LineTo {x:-50 y:-70},
               LineTo {x:-50 y:-50},
               LineTo {x:50 y:-50},
               LineTo {x:50 y:-30},
               LineTo {x:30 y:-30},
               MoveTo {x:0 y:-150},
               LineTo {x:0 y:-50},
               LineTo {x:50 y:50},
               LineTo {x:-50 y:50},
               LineTo {x:0 y:-50},
               MoveTo {x:0 y:50},
               LineTo {x:0 y:150}
           ]
           stroke: Color {red:0.7 green:0.25 blue:0.0}
           strokeWidth: 10
           strokeDashArray: []
           fill:null
           transform: [
             Rotate {x: 120 y:160 angle: 30},
             Translate {x: 120 y:160 },
             Scale {x:0.5 y:0.5 },
           ]
       }              
       ]
}


[Java ME and J2ME] ( April 09, 2008 08:47 PM ) Permalink Comments [6]





Theme originally based on design by Bryan Bell