Showing posts with label JavaFX. Show all posts
Showing posts with label JavaFX. Show all posts

Monday, April 2, 2012

JavaFX 2.1 example on Linux x64

JavaFX 2.1 Developer Preview for Linux has been released recently, unfortunately only for 32bit architecture. But what about x64? Well, I have Ubuntu x64 10.04 LTS and it also works :D! Here are the tips to run BrickBreaker example, which comes with JavaFX SDK examples.

To download SDK preview we should look at proper download section here. Also we need to download latest JavaSE JDK 7 but for Linux x86 (despite the fact we are using 64-bit Linux). After downloading all necessary packages, just unpack them wherever you want.

Right now JavaFX SDK examples are distributed in separate package. It is available at the bottom of this page (notice that we need examples for Linux!). Inside package we may find src directory with BrickBreaker sources, a simple game which we will compile and run.

The easiest choice of IDE for latest JavaFX release is Netbeans 7. To be able to run and compile FX projects we need to setup Java platforms. Just select "Tools->Java Platforms" from the menu. Click "Add platform..." and select directory when we have extracted JavaSE JDK 7, then select "Finish". We have added new JVM, but we need to enable FX. Select new added Java platform in "Java Platform Manager" window and navigate to "JavaFX" tab. Enable JavaFX and point to JavaFX SDK directory by clicking "Browse..." next to "JavaFX SDK:" input.

Now we can open BrickBreaker project in NetBeans and open its properties window. Navigating to "Libraries" section in "Project Properties" window we should select Java platform with enabled JavaFX libraries. Then we can compile and run project right from IDE.

Wednesday, January 25, 2012

Java FX 2.0 released

A new JavaFX 2.0 has been released! I remember that I have been trying for a while to work with previous versions 1.1 and 1.2, and to be honest it was horrible experience. I did that because I have been searching for the tool which allows to create true multimedia application in JAVA. Also I wanted to create a very nice GUI. Well I think that previous versions of JavaFX were completely failures...

Need to check 2.0 though, because I saw some video tutorials and it looks really nice!

UPDATE

So I could not resist myself and today I downloaded JDK 1.7u2 (with JavaFX 2.0 support) and NetBeans 7.1. Unfortunately I had to work on Windows, because I could not find proper version of JavaFx SDK for 64bit Linux, on which I usually work. I managed to do some simple tutorials from http://docs.oracle.com/javafx/index.html.

My first impression is that the whole API is very simple and in a few lines of code we get really nice GUI! What is more, there is also a set of classes that allows to integrate Swing with JavaFX. Not to mention about using CSS for application skinning and creating application layouts and components inside XML files. Oh! And there is even a possibility to use for example JavaScript or Groovy to write applications' logic!

Looking forward to JavaFX 2.0 for 64bit Linux architecture. Finally we can create nice looking desktop application in Java, which can also handle multimedia content as well. It is time to start thinking about rewriting my old Swing projects :)