Posted: under JavaFX News, JavaFX Technology.
Tags: eclipse, javafx, plug-in, sdk
Last week, the Eclipse plugin for JavaFX 1.2.1 was released. This is an important update since June 2009 and it is a good news to Eclipse users. Because Sun is the development force behind NetBeans, NetBeans naturally becomes the “default” IDE of JavaFX. This is why JavaFX SDK is usually bundled with NetBeans for download.
I think Eclipse and NetBeans both are excellent open source IDEs for Java developers. They provide comparable features and functions. The only sad thing is that their plug-ins are not compatible with each other. Therefore, the JavaFX plug-ins must be developed separately for Eclipse and NetBeans. I personally do not have much preference from one over the other. For people who get used to the Eclipse environment have been longing for a nice JavaFX IDE without being forced to switch to NetBeans. This newly released JavaFX plug-in not only provides the support of the latest SDK 1.2.1, but also can import NetBeans projects directly. You know this helps a lot because many sample codes are coming as a NetBeans project.
If you are a fan of Eclipse( and javaFX ), you should definitely check out this plug-in here:
http://javafx.com/docs/gettingstarted/eclipse-plugin/release-notes.jsp
Other links:
JavaFX Used in Vancouver Olympics
UK Citizenship Test for Britain Applicant
Australian Citizenship Test Practice Question
British UK Australian Citizenship test on iphone
US Citizenship Test Practise
Citizenship iPhone Apps
Jan 16 2010
Posted: under JavaFX News.
Tags: how-tos, javafx
Javafx.com has published a collection of articles on JavaFX techniques. These “How-Tos” articles serve as excellent references for JavaFX coder. You can think of them as “classified FAQs”. It helps people get started to write JavaFX code effectively. If you are new to JavaFX, I am sure it answers most of your “How do I …” questions. You can check them out here.
In the section of “Build a game”, there are two of my articles. One is the Pac-Man Game series published on insideRIA.com. The other is the Online Wish Tree Prototype on this blog. They are about how to develop games in JavaFX.
BTW, I finished reading a JavaFX book recently. It is called “Essential JavaFX” by Gail and Paul Anderson. This book helps you quickly get to know everything “essential” in JavaFX. Though it is not an advanced book, it does let you jump start into the language. You can read a review here. The Chinese version of review is here.
Dec 05 2009
Posted: under JavaFX News, JavaFX Technology, pac-man.
Tags: javafx, pac-man, widget, widgetfx
To fully take advantage of the power of JavaFX 1.2, Stephen Chin just released the WidgetFX 1.2 API beta version. There is even a widget contest running until the end of July. [Update: Steve had released the WidgetFX 1.2 version on June 29. ]
Just before the JavaOne 2009, Jim Weaver asked me to write a widget for my JavaFX Pac-man game. The WidgetFX API was quite simple to use, so I finished it pretty soon. The game widget later got demo-ed on Jim and Steve’s JavaOne sessions. There was a small problem of the pac-man widget: it run relatively slow due to the performance issue of JavaFX 1.1. Since JavaFX 1.2 and WidgetFX 1.2 are ready now, I am modifying the code to see the improvement on performance.
First, the JavaFX code of the Pac-Man game needs to be modified a little bit for JavaFX 1.2. Since multi inheritance is gone, we need to use mixin classes now. You can refer to my articles on insideRIA.com for details of the code. Changes for JavaFX 1.2 were given on comments of Article 4 by Patrick Webster. I also added in a pausing key(”P” button) handling for the game. I compiled the game into a pacman.jar file.
The next step is to write the widget. Actually, the code is quite simple if you do not have stuffs like configuartion etc. Let’s look at the code below:
/*
* PacManWidget.fx
* http://www.javafxgame.com
*/
package pacmanwidget;
import org.widgetfx.Widget;
/**
* @author Henry Zhang
*/
def defaultWidth = 528.0;
def defaultHeight = 576.0;
def maze = pacman.Maze {};
var widget:Widget = Widget {
width: defaultWidth
height: defaultHeight
aspectRatio: defaultWidth / defaultHeight
content: maze
resizable: false
onDock: function():Void {
maze.pauseGame();
}
}
return widget;
In the standalone game, an instance of the Maze class was put into the content variable of a Stage. Now, instead of putting it into a Stage, we add it into a Widget. To do this, we can just set the content variable of a Widget instance. Other attributes of the Widget class are quite straightforward, mostly for resizing purposes. The next thing is to write a onDock() function to pause the game when the widget gets docked. The game can be resumed after pressing the “p” button when it is undocked.
The last thing is to deploy it on a web server. We need a JNLP file. Be sure to write the jnlp file of the JavaFX 1.2 style. Netbeans can generate the JNLP file which we can modify for deployment. I listed below part of my jnlp file. Besides the widget code PacManWidget.jar, there are supporting jar files( pacman.jar and WidgetFX-API.jar) under the /lib folder as well. Notice that there is a bug in the generated JNLP file by NetBeans 6.5.1: the <update> tag is missing a slash(/) at the end of the tag.
. . . . . .
<resources>
<j2se version="1.5+" />
<extension name="JavaFX Runtime"
href="http://dl.javafx.com/1.2/javafx-rt.jnlp"/>
<jar href="PacManWidget.jar" main="true"/>
<jar href="lib/pacman.jar"/>
<jar href="lib/WidgetFX-API.jar"/>
</resources>
<application-desc main-class="com.sun.javafx.runtime.main.Main">
<argument>MainJavaFXScript=pacmanwidget.PacManWidget</argument>
</application-desc>
<update check="background" />
. . . . . .
Now, you can click on the below button to start the Pac-man widget for JavaFX 1.2. Enjoy!
Pac-Man Widget 1.2
Jun 08 2009
Posted: under JavaFX News.
Tags: 1.0, javafx, sdk
Today, the JavaFX 1.0 SDK is officially released. It is really exciting! The JavaFX platform opens a huge market for developers and UI designers to work together for a rich interface application(RIA). Because Java technology is already on more than 10M devices(PDA, computers, cellphones, etc), this new scripting language is expected to be widely accepted by most Java developers.
One of the most innovative features, I think, should be the eye-opening Drag-to-install trick. This is support by the JDK 1.6U10. Applets can be dragged directly onto a desktop and run in a seperate window. This bring us the simplicity of installation of internet application.
Other useful and powerful features attractive to me include Netbeans IDE, video support, production suite. I downloaded and try the IDE, it is very simple to build your first “hello world” JavaFX program.
Refer to A JavaFX Demo Game
Dec 04 2008
Posted: under JavaFX News.
Tags: javafx, sdk
Yesterday, the JavaFX Preview SDK is available for download. This is very exciting news. Since its debute on JavaOne 2007, many enthusiasts cheered of this preview release. The formal release is schedule to be out on Dec 2, 2008. We can’t wait to get it.
Though JavaFX is a technology based on Java, it totally changes the world of “Your Dad’s Java”. Many GUI related things can be done easily on JavaFX, such as graphic, video, audio, and anything for RIA. People are excited because JavaFX provides a very simple way to implement these elements in an RIA’s GUI.
JavaFX also links the world between art designer and computer programmer. Traditionally, these two kinds of folks find them hard to work with each other. With the birth of JavaFX, we finally have an approach to combine two things easily.
With a few lines of code, JavaFX can render sophiscated GUIs that used to be done by Java with 10 times of source code. JavaFX has many build-in features of doing animation, graphical effects that are seen photoshop.
I will download and test drive the preview SDK soon.
Aug 01 2008