Example usage for javafx.scene.paint Color ALICEBLUE

List of usage examples for javafx.scene.paint Color ALICEBLUE

Introduction

In this page you can find the example usage for javafx.scene.paint Color ALICEBLUE.

Prototype

Color ALICEBLUE

To view the source code for javafx.scene.paint Color ALICEBLUE.

Click Source Link

Document

The color alice blue with an RGB value of #F0F8FF

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    scene.setFill(Color.ALICEBLUE);
    stage.setScene(scene);/*from  w w w  .ja  v a 2 s  .c  om*/
    stage.show();

    stage.setWidth(300);
    stage.setHeight(200);

    label.setStyle("-fx-font: 25 arial;");
    label.setLayoutX(40);

    rect.setStroke(Color.BLUE);
    rect.setStrokeWidth(3);
    rect.setFill(Color.WHITE);

    final String[] greetings = new String[] { "A", "B", "C", "D", "E" };
    final ChoiceBox<String> cb = new ChoiceBox<String>(
            FXCollections.observableArrayList("a", "b", "c", "d", "e"));

    cb.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
        public void changed(ObservableValue ov, Number value, Number new_value) {
            label.setText(greetings[new_value.intValue()]);
        }
    });

    cb.setTooltip(new Tooltip("Select the language"));
    cb.setValue("English");
    HBox hb = new HBox();
    hb.getChildren().addAll(cb, label);
    hb.setSpacing(30);
    hb.setAlignment(Pos.CENTER);
    hb.setPadding(new Insets(10, 0, 0, 10));

    ((Group) scene.getRoot()).getChildren().add(hb);

}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    scene.setFill(Color.ALICEBLUE);
    stage.setScene(scene);/*from  w ww.ja  v  a  2  s. c  o m*/
    stage.show();

    stage.setTitle("ChoiceBox Sample");
    stage.setWidth(300);
    stage.setHeight(200);

    label.setStyle("-fx-font: 25 arial;");
    label.setLayoutX(40);

    rect.setArcHeight(8);
    rect.setArcWidth(8);
    rect.setStroke(Color.BLUE);
    rect.setStrokeWidth(3);
    rect.setFill(Color.WHITE);

    final String[] greetings = new String[] { "Hello", "Hola", "??????", "?", "?????" };
    final ChoiceBox cb = new ChoiceBox(
            FXCollections.observableArrayList("English", "Espaol", "???????", "????", "???"));

    cb.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
        public void changed(ObservableValue ov, Number value, Number new_value) {
            label.setText(greetings[new_value.intValue()]);
        }
    });

    cb.setTooltip(new Tooltip("Select the language"));
    cb.setValue("English");
    HBox hb = new HBox();
    hb.getChildren().addAll(cb, label);
    hb.setSpacing(30);
    hb.setAlignment(Pos.CENTER);
    hb.setPadding(new Insets(10, 0, 0, 10));

    ((Group) scene.getRoot()).getChildren().add(hb);

}

From source file:eu.ggnet.dwoss.redtape.document.DocumentUpdateView.java

private void initFxComponents() {
    final JFXPanel jfxp = new JFXPanel();
    positionPanelFx.add(jfxp, BorderLayout.CENTER);

    Platform.runLater(() -> {/*from   w  ww.  j  av a2  s. c o m*/
        BorderPane pane = new BorderPane();
        Scene scene = new Scene(pane, Color.ALICEBLUE);

        positionsFxList = new ListView<>();
        positionsFxList.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
        positionsFxList.setCellFactory(new PositionListCell.Factory());
        positionsFxList.setItems(positions);
        positionsFxList.setOnMouseClicked((mouseEvent) -> {
            if (mouseEvent.getButton().equals(MouseButton.PRIMARY) && mouseEvent.getClickCount() == 2) {
                if (isChangeAllowed()) {
                    controller.editPosition(positionsFxList.getSelectionModel().getSelectedItem());
                    positionsFxList.refresh();
                } else {
                    Alert.show("nderung an Positionen ist nicht erlaubt.");
                }
            }
        });

        pane.setCenter(positionsFxList);
        jfxp.setScene(scene);
    });
}