Running Text vertikal yang dinamis


import javafx.scene.shape.Line;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.transform.Translate;
import javafx.animation.Timeline;
import javafx.animation.KeyFrame;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import javafx.ext.swing.SwingTextField;
/**
* @author bhangun
*/

// y variable updated periodically
var y : Number = 200;

// Timeline updates y variable
var timeline : Timeline = Timeline {
repeatCount: Timeline.INDEFINITE
keyFrames :
KeyFrame {
time : 16ms
action : function() : Void {
y -= 1;
if( y == -1 ) { y = 200 }
}
}
};
var teksf:SwingTextField=SwingTextField {
columns: 10
//text: bin;
editable: true
};
Stage {
scene : Scene {
fill : Color.WHITE
content : [ teksf,
Text {
font : Font {
size: 24
}
transforms : [ Translate { y : bind y }]
content: bind teksf.text;
x: 10
}]
}

title : “Linear”
width : 200
height : 232
}

// Start animation
timeline.play();

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: