/**
*
* @author Joko Adianto
*/
public class JavaFXComboBox extends Application {
@Override
public void start(Stage primaryStage) {
ComboBox<String> comboBox = new ComboBox<>();
ObservableList<String> oblTeman = FXCollections.observableArrayList();
comboBox.itemsProperty().setValue(oblTeman);
oblTeman.addAll("Hannibal Lecter", "Three Fingers",
"Saw Thooth", "Chucky", "Tiffany", "Anabelle");
StackPane root = new StackPane();
root.getChildren().add(comboBox);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Daftar Teman Masa Kecil");
primaryStage.setScene(scene);
primaryStage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
No comments:
Post a Comment