Home > JavaFX > ChoiceBox (JavaFX 1.3)

ChoiceBox (JavaFX 1.3)


JavaFx versi 1.3 benyak memiliku komponen-komponen yang lebih menarik dari versi sebelumnya. Salah satunya adalah ChoiceBox. Kelas ini belum ada pada versi sebelumnya, namun dengan versi 1.3 ChoiceBox dapat terlihat lebih menarik. Hampir mirip dengan comboBox, namun GUI untuk ChoiceBox terlihat lebih menarik..

Source Code:

/*
 * This Project created by Pizaini
 * zheiner.taurus@gmail.com
 * visit "pizaini.wordpress.com"
 *
 * Intel Centrino
 * Copyright 2010 by Pizaini
 */
/*
 * ChoiceCok.fx
 *
 * Created on 26 Apr 10, 13:23:33
 */

package com.pizaini.fx;

import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.control.ChoiceBox;

/**
 * @author Pizaini
 */

// My Codes
var list = ["Pekanbaru","Padang","Jakarta","Makassar","Palembang","Manado"];
Stage {
    title : "ChiceBox and ListView"
    scene: Scene {
      width: 500
      height: 350
       content: [
             ChoiceBox {
                items: list
                translateX:20
                translateY:20
             }
             ListView {
                vertical: false
                items: list
                translateX:20
                translateY:50
             }
        ]
 }
}

Thanks…

  1. No comments yet.
  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: