Juha Anon

Greenhorn
+ Follow
since May 13, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Juha Anon

I would say that for the moment you can't do anything serious with JavaFX, but keep an eye on it. It to early to use in practice, but it would like to be as ubiquitus as Flex is. In practice, Flex rules that market.

JSP, JavaScript, and CSS will be important for all practical work, for now.
As a Java web-developer, you should also try Google Web Toolkit (GWT). If you use that, you have a better development environment -- and writes less of your own JavaScript. But you still need to know JavaScript and CSS to make something real with it. Maybe less so in the future, I would hope.

I'll mention CSS once more, so you don't miss that. If you can do something with CSS, you shouldn't do that with JavaScript. So learn it, and learn it well.

-- Juha
16 years ago
I see that I was unclear. When saying: You must add the name of the Hello.fx (or just the class name, �Hello�) to tell the shell what to run.

I ment: set Hello as argument (in the Arguments tag) to the FXShell.

-- Juha
16 years ago
Eclipse is my favorite for serious work, but I would say that it's easier to start out from the demo application. There's no setup needed.

I downloaded openjfx-20070506220507.tar.gz and extracted it. Then just changed to the directory:
trunk/demos/demo

and run the command:
./demo.sh

It worked!

I haven't any classpath set. The only Java environment I have is that JAVA_HOME is set, and $JAVA_HOME/bin is in my path.

I'm running Java 1.6, but 1.5 is probably also good.

Run the tutorial, and start changing the scripts there. No need to recompile, or run! That's a small, but cute, development environment, I think.

-- Juha
16 years ago
Instructions for the first step using the Eclipse plugin -- from novice to novice.

Do a Hello World
=============
After installing the plugin, you won't see any change at all in the Eclipse interface except when you create the first JavaFX file. Create a new Java Project, and then Hello.fx in the source directory:

new | other... | javaFX | JavaFX File.

(The source directories are managed exactly like you would do with Java sources.)

When you add your first .fx-file in your Java project, the JavaFX plugin knows it should be a JavaFX-project, and adds the .jar files which are needed. It also knows that the run-configuration should now utilize the FXShell as main class.

The contents of Hello.fx may be something like this:

import javafx.ui.*;
import java.lang.System;

Frame {
content: Button {
text: "Press Me"
action: operation() {
System.out.println("You pressed me");
}
}
visible: true
}

You run it by right-clicking on the project (or the file you want to run) and add a new configuration for a �JavaFX Application�. It will have net.java.javafx.FXShell for Main class. You must add the name of the Hello.fx (or just the class name, �Hello�) to tell the shell what to run. (Otherwise, it compiles and run the empty set of classes without complaining: very annoying!)

The second step: run the demo application.
==============================
To run the demo application in Eclipe, you may use �demo.DemoLauncher� for argument to the FXShell.

You must also add the �demos� directory as a source directory along with �src�. You do that under Project | Properties | Java Build Path | Source. Otherwise, I didn't have to change anyting from what I got from the Subversion trunk (or the source download).

There's some Red in the Source: ignore it!
==============================
There is one spot in the code that the plugin complains about, but it worked anyway. Someone will remove that eventually... I guess.

This is the place causing it:

incompatible types: expected net.java.javafx.type.ValueList, found javafx.ui.canvas.Group
in new Group {transform: translate(30, 30), content: new ViewOutline {selected: true, view: widget, rectHeight: h, rectWidth: w}}
Tutorial Project/javafxpadJavaFXPad.fxline 980
16 years ago
When running the JavaFX demo, I can change the GUI and get immediate response: I can see what't the effect of changing a color, size, transparencey, tranform, etc.
Groovy would be a nice language to use instead of JavaFX, but will it be possible to get that immediate feedback?

The challange maybe isn't to write better Groovy version for the JavaFX, but to make Groovy a better development environment for this kind of application.

Competition is good: we need to make the SwingBuilder handle Java2D and animations. If JavaFX can do that, Groovy should also be able to do it.

I have been thinking of using Groovy (and SwingBuilder) for GWT. And the GWT way would work also for JavaFX -- if it ever made it to the browser. We could generate it all from our Groovy source, in the GWT manner -- even if Groovy itself will never be ubiquitous in the browers.
Let JavaFX be the small runtime in the mobile phone, and let Groovy be the development environment we do all the development work in.
16 years ago