Home > JavaFX > Simple Data Binding with GUI

Simple Data Binding with GUI


Splash

Source Code:

/*
 * Binding.fx
 **
 *pizaini.wordpress.com
 *zheiner.taurus@gmail.com
 *
 * Created on 22 Jan 10, 13:07:46
 */

package belajar.gui.binding;

import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.shape.Circle;
import javafx.scene.paint.Color;
import javafx.scene.paint.RadialGradient;
import javafx.scene.paint.Stop;
import javafx.scene.paint.LinearGradient;
import javafx.ext.swing.SwingSlider;
import javafx.scene.Cursor;
import javafx.scene.effect.DropShadow;

/**
 * @author Pizaini
 */

// My Code is Here
var slider = SwingSlider{
   minimum:0, maximum:80;
   value:0;
   translateX:20, translateY:190
   cursor:Cursor.HAND
 }
var circle:Circle;
Stage{
   title:"GUI Binding Slide Bar"
   scene: Scene{
     width:500;
     height:450;
     fill: LinearGradient{
        startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0, proportional: true
        stops: [
           Stop {offset: 0.0 color: Color.WHITE},
           Stop {offset: 1.0 color: Color.BLUE}
     ]
    }
    content: [
        circle = Circle{
            effect:DropShadow{
               color:Color.RED;
               radius:bind slider.value + 40
            }
           centerX:bind slider.value+100, centerY:100;
           radius:80;
           stroke:Color.YELLOW;
           fill:RadialGradient{
                centerX:100, centerY:100;
                radius:100;
                focusX:50, focusY:100;
                proportional:false;
                stops: [
                     Stop{ offset:0.1 color:Color.GREEN; }
                     Stop{ offset:1.0 color:Color.WHITE; }
                ]
           }
       },
       slider,
    ]
 }
}

  1. Zhein
    5 February 2010 at 22:58

    Good Post

  1. No trackbacks yet.

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: