Skip to main content

Problems with animation

4 replies [Last post]
Joined: 2008-07-29
Points: 0

Hello to everybody.
I'm using Netbeans 6 with the javaFx plugin and it doesn't find the javafx.animation package (the one with TimeLine and KeyFrames classes). I've trying uninstalling and reinstalling the javaFx plugin but still doesn't find it.

I need it for a program like this:
var somevar....
function blabla()....

operation update(){

The update operation update the variables using some of the previously defined functions.
I need some way to do this operation each second (for example) without blocking the GUI so the user still can interact

Any suggestion? Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2008-07-29
Points: 0

Well, I managed to resolve the problem. (I forgot to include the package name over the imports)

Thanks to everyone! :D

Joined: 2008-07-29
Points: 0

Okay. I got NetBeans 6.1 and had the JavaFx installed, but when trying to run your
example program (and some others), this exception appears:

java.lang.NoClassDefFoundError: prueba/Main
Caused by: java.lang.ClassNotFoundException: prueba.Main
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(
Could not find the main class: prueba.Main. Program will exit.

I've read something about this being a problem of the JDK 6. I've both JDK 5 and 6 but in NetBeans 6.1 javaFX compiler needs JDK 6.

Joined: 2007-07-12
Points: 0

Did you try to install the latest JavaFX Script plugin from ?

It works with NetBeans 6.1.

The following example should work there:

import javafx.animation.Timeline;
import javafx.animation.KeyFrame;

import java.lang.System;

function update () {

var timeline = Timeline {
repeatCount: Timeline.INDEFINITE
keyFrames : [
KeyFrame {
time : 1s
action: function() {


Joined: 2005-08-24
Points: 0

JavaFX is very much a moving target at the moment.

See this page for milestone and dev builds. I haven't played with animation, but you probably need one of these builds.

Chas Douglass