Search in sources :

Example 1 with JFXComboBox

use of com.jfoenix.controls.JFXComboBox in project JFoenix by jfoenixadmin.

the class ComboBoxDemo method start.

@Override
public void start(Stage primaryStage) throws Exception {
    JFXComboBox<Label> c = new JFXComboBox<>();
    c.getItems().add(new Label("Java 1.8"));
    c.getItems().add(new Label("Java 1.7"));
    c.getItems().add(new Label("Java 1.6"));
    c.getItems().add(new Label("Java 1.5"));
    c.setEditable(true);
    c.setPromptText("Select Java Version");
    HBox pane = new HBox(100);
    HBox.setMargin(c, new Insets(20));
    pane.setStyle("-fx-background-color:WHITE");
    pane.getChildren().add(c);
    final Scene scene = new Scene(pane, 300, 300);
    scene.getStylesheets().add(ComboBoxDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
    primaryStage.setTitle("JFX ComboBox Demo");
    primaryStage.setScene(scene);
    primaryStage.setResizable(false);
    primaryStage.show();
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) JFXComboBox(com.jfoenix.controls.JFXComboBox) Label(javafx.scene.control.Label) Scene(javafx.scene.Scene)

Aggregations

JFXComboBox (com.jfoenix.controls.JFXComboBox)1 Insets (javafx.geometry.Insets)1 Scene (javafx.scene.Scene)1 Label (javafx.scene.control.Label)1 HBox (javafx.scene.layout.HBox)1