May 09, 2007

Inside JavaFX !

Sun revealed its new product family: JavaFX for development on Desktop, Web , mobile and other electronic equipments like TV and Setup box. The product features a new content scripting language called JavaFX Script. For now, Sun and released JavaFX Mobile and JavaFX Script the first applications from the JavaFX family. Sun defines JavaFX as "JavaFX is a new family of Java technology-based products that will help content providers create and deploy rich Internet applications (RIA)." They also talk about its ability to create interactive content, applications and services from desktop to mobile devices to the living room.

At a glance JavaFX is going to make use of all advantages java currently provide - write-once-run-anywhere, portability, application security model, ubiquitous distribution and enterprise connectivity. JavaFX Script is going to help developers create interactive content and it will be not a procedural scripting language. At the same time JavaFX Mobile will be Sun's software system for mobile devices.

The new scripting language have the following features:
  • JavaFX Script uses a declarative syntax for specifying GUI components, so a developer's code closely matches the actual layout of the GUI.
  • Through declarative databinding and incremental evaluation, JavaFX Script enables developers to easily create and configure individual components by automatically synchronizing application data and GUI components.
  • JavaFX Script will work with all major IDE. Plugin for Eclipse is already available!
  • Unlike many other Java scripting languages, JavaFX Script is statically typed and will have most of the same code structuring, reuse, and encapsulation features that make it possible to create and maintain very large programs in Java.
  • JavaFX Script is capable of supporting GUIs of any size or complexity and make use of Swing.
Sun has also started Project OpenJFX, which is a project of the OpenJFX community for sharing early versions of the JavaFX Script language and for collaborating on its development. The JavaFX Script downloads, NetBeans and Eclipse plugins are available here. You can also find demos for the script. And here is "hello world" fx script:

     import javafx.ui.*;

Frame {
title: "Hello World JavaFX"
width: 200
height: 50
content: Label {
text: "Hello World"
}
visible: true
}
So to get started all you need is an IDE with JavaFX Script plugin and JDK 1.5 +. You can find the tutorial and language reference at https://openjfx.dev.java.net/.

No comments :