Saturday Feb 14, 2009

Get ready for any mobile screen - JavaFX

Developers are ready for any mobile screen. What does it means when we say "any mobile screen". I will explain in a minute. Lets take a sample from javafx sample repository. For a while, I am taking my sample, Carousel. And I will show you how it works on mobile screen. 

We can see all things changed dynamically with change in orientation or screen size. The second is landscape mode which has a different mobile screen size. Images moved to the right position(center of the screen), lower bar adjusted its position according to screen size. 

Believe me, not more than 5 lines of code is required for these changes. This is what we call the power of binding. Components are so nicely binded with each other, that your idea is your implementation.

We have checked this sample on lot of mobile screen size and its running fine. In general, I can assure you, it will run fine on all screen(can be little problem on too small screen size, because there is no image resizing we have done in code. We can expect this behavior will  most of the application which will run on mobile.

 Thats why I said, developers are ready for any mobile devide and any mobile screen. Happy FX'ing.

Thursday Feb 12, 2009

JavaFX + Mobile

So, its a short wait. JavaFX for mobile is here. I have tried quite a good number of application on FX Mobile and its running smooth. But why to take my words, download and give a try

New sample section is updated too + some nice new samples like Calculator, Ripple Effect and many more...

For Student, Developer, Coder or in one word for Learner(we all come in this section), have a look at JavaFX with Passion

Some of the industrial leader committed to FX, have a look : http://www.javafx.com/partners/

So, "The most pervasive and powerful mobile platform is now the most expressive" - Feel it :).




Wednesday Dec 10, 2008

Spring Motion - Physics in JavaFX

3 weeks back, we were thinking of some cool application to make. I am a guy who has seen very less outside world, so coming up with some great idea is always tough for me. So, deciding that, I went back to my tenth class physics book and saw some of the cool physics motion. Its one of the tough subject and always screw me in exam. Searching some of the easy equation, I though to make one spring motion. Meantime, I though there is some spring motion residing in our repository. Actually one of the Josh applications do it in awesome way, but still we were missing the actual feel of Spring motion because of the gig-gag and spiral stuff attached to the wall and spring is going up and down in it, with a complete view of awesomeness :). This is what finally we achieve from this blog :

 I can still bet this can be 3 times much better than what you are seeing here. So, little of good news here that this sample can be executed on mobile

Here are the code files :

1. Main file.

2. Spring file.

3. SpringEquation file.

Enjoy FX'ing !

Saturday Dec 06, 2008

Mobile + Desktop JavaFX !

Just want to put the attention on one important point regarding the coding in JavaFX. Everyone who is using JavaFX has to understand that this technology is supported on Mobile, Desktop and TV(tomorrow it will be). So, its important as a developer to write Generic Applications which run across the platform. In such cases you need to know how to adjust some silly things in the code, like so desktop it can be a big font whereas you need to reduce font size for mobile or same case with images. 

Here is one sample code, which can show you how to do :

package sample11;

import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;

var mobile = FX.getProperty("javafx.me.profiles");
var isMobile = (mobile != null);
var s = 24;
var content = "Default";
if(isMobile == true) {
    s = 10;
    content = "Content in Mobile"
}
else { 
    s = 20;
    content = "Content on Desktop"
}

Stage {
    title: "Checking the Font"
    width: 350
    height: 280
    scene: Scene {
        content: Text {
            font : bind Font {
                size : s
            }
            x: 10, y: 30
            content: bind content
        }

    }
}

Run it on Desktop and on Mobile and see the different output.

(How to run on Mobile ? ---> Netbeans6.5 -> YourProject -> Right Click ->Properties -> Run -> Run as Mobile Emulator)

This feature has been nicely used in this sample :  InterestingPhotos.

About

Hi, I am Vaibhav Choudhary working in Sun. This blog is all about simple concept of Java and JavaFX.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today