Skip to main content

Anomalous beheavior in Javafx script with dur operator

1 reply [Last post]
zaumen
Offline
Joined: 2008-05-24

While the issue might be simply not finding documentation on the sematics and usage
of the "dur" operator, I discovered that the following two very short and very similar
programs behave differenently. The objective was to create a "hello world" program
that would print "Hello World" one character at a time at 1 second intervals. The
program that worked as expected is
--------------------
import javafx.ui.*;

class OurLabel extends Label {}
trigger on new OurLabel {
this.text = ["H", "He", "Hel", "Hell", "Hello", "Hello W",
"Hello Wo", "Hello Wor", "Hello Worl",
"Hello World"] dur 9000 linear;
}

Frame {
title: "Hello World"

content: OurLabel {}
visible: true
}
---------------------
The original, and slightly simpler program would show only part of the text string
and then stop, and would not add a character to the label at 1 second iintervals.
The behavior depends on the number that follows "dur". You wee much more of
the string when the value is 1 or 2. This program is:
---------------------
import javafx.ui.*;

Frame {
title: "Hello World"
content: Label {
text: ["H", "He", "Hel", "Hell", "Hello", "Hello W",
"Hello Wo", "Hello Wor", "Hello Worl",
"Hello World"] dur 9000 linear
}
visible: true
}
-------------------
I'm running a ubuntu 6.06 system with Sun's JRE:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sjoedzj
Offline
Joined: 2008-10-02

the dur operator doesn't work anymore. Use the Timeline class..