I did this little script to download the last version of JavaFX continuos build and install it for you.
#!/bin/sh
envfile=$HOME/.bash_profile
#download and unpatch the last build of JavaFx
mkdir jfx
cd jfx
wget http://openjfx.java.sun.com/hudson/job/openjfx-compiler/lastBuild/artifact/openjfx-compiler/dist//*zip*/dist.zip
unzip dist.zip
rm dist.zip
#set files at bin folder as executable
chmod +x dist/bin/*
#add those executables to the path
echo "PATH=\$PATH:`pwd`/dist/bin" >> $envfile
Save this script as install_jfx.sh and execute it. Probably you want to execute it at you home directory. If you want to install JavaFX to root change envfile for /root/.bash_profile, if you want to install to all users change for /etc/profile. I tested this script successfully on my Ubuntu 8.04.
After that open a new terminal and try to see if javafx, javafxc and javafxdoc are available. You can test your enviroment with this simple program.
As the earlies versions of OpenSolaris, my terminal is without colors. That’s a little annoying. As the default user uses Bash you can configure your Bash options in the file ~/.bashrc. Insert in the last lines of your .bashrc file:
alias ls=’ls –color=auto’
Save, close and open your terminal (or just type source ~/.bashrc).
Two simple JavaFX code handling onMouseDragged event.
import javafx.ui.*;
import javafx.ui.canvas.*;
Canvas {
content: Circle {
var x = 50
var y = 50
transform: bind translate(x, y)
radius: 30
fill: red
onMouseDragged: operation(e) {
x += e.localDragTranslation.x;
y += e.localDragTranslation.y;
}
}
}
import javafx.ui.*;
import javafx.ui.canvas.*;
Canvas {
content: Circle {
var x = 50
var y = 50
var radius = 30
transform: bind translate(x, y)
radius: bind radius
fill: red
onMouseDragged: operation(e) {
if (e.button == 1){
x += e.localDragTranslation.x;
y += e.localDragTranslation.y;
}
if (e.button == 3) {
radius += e.localDragTranslation.x;
}
}
}
}
import javafx.ui.*;
import javafx.ui.canvas.*;
Canvas {
content: [
Rect {x: 50, y: 50, width: 50, height: 50, fill: orange },
Circle {
var x = 50
var y = 50
var radius = 30
var color = red:Color
transform: bind translate(x, y)
radius: bind radius
fill: bind color
onMouseDragged: operation(e) {
if (e.button == 1){
x += e.localDragTranslation.x;
y += e.localDragTranslation.y;
}
if (e.button == 3) {
radius += e.localDragTranslation.x;
}
}
onMousePressed: operation(e){
color = Color {blue: 0.0, green: 0.0, red: 1.0, opacity: 0.5};
}
onMouseReleased: operation(e){
color = red:Color;
}
}]
}