Example usage for javafx.scene Scene setFill

List of usage examples for javafx.scene Scene setFill

Introduction

In this page you can find the example usage for javafx.scene Scene setFill.

Prototype

public final void setFill(Paint value) 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>();
    choiceBox.setItems(cursors);/*from  w w  w .  jav a  2  s.  c  o  m*/

    System.out.println(choiceBox.valueProperty());

    VBox box = new VBox();
    box.getChildren().add(choiceBox);
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>();
    choiceBox.setItems(cursors);/*from  www . j  av a 2  s . c om*/

    choiceBox.setValue("a");

    VBox box = new VBox();
    box.getChildren().add(choiceBox);
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>();
    choiceBox.setItems(cursors);//w  w w .j ava  2 s. c o m

    System.out.println(choiceBox.showingProperty());

    VBox box = new VBox();
    box.getChildren().add(choiceBox);
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    VBox box = new VBox();
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);

    Line line = new Line();
    line.setStartX(0.0f);//from w w  w  .  j  a va2s .co  m
    line.setStartY(0.0f);
    line.setEndX(100.0f);
    line.setEndY(100.0f);

    box.getChildren().add(line);

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>();
    choiceBox.setItems(cursors);/*from  www . ja  va 2  s .  co  m*/

    SingleSelectionModel ssm = choiceBox.getSelectionModel();
    choiceBox.setSelectionModel(ssm);

    VBox box = new VBox();
    box.getChildren().add(choiceBox);
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    VBox box = new VBox();
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);

    Line line = new Line(0, 0, 0, 0);
    line.setStartX(0.0f);//from   w  w  w  .j  a  v  a2 s.c om
    line.setStartY(0.0f);
    line.setEndX(100.0f);
    line.setEndY(100.0f);

    box.getChildren().add(line);

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>(cursors);

    StringConverter sc = new NumberStringConverter();

    choiceBox.setConverter(sc);//from  ww w  .j a v a2  s.c om

    VBox box = new VBox();
    box.getChildren().add(choiceBox);
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox choiceBoxRef = ChoiceBoxBuilder.create().items(cursors).build();

    VBox box = new VBox();
    box.getChildren().add(choiceBoxRef);
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    stage.setScene(scene);//from   w w w.  ja  v  a2  s  .c  om
    stage.show();
    scene.cursorProperty().bind(choiceBoxRef.getSelectionModel().selectedItemProperty());

}

From source file:Main.java

@Override
public void start(Stage stage) {
    VBox box = new VBox();
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    Stop[] stops = new Stop[] { new Stop(0, Color.BLACK), new Stop(1, Color.RED) };
    LinearGradient lg1 = new LinearGradient(0, 0, 1, 0, true, CycleMethod.NO_CYCLE, stops);

    Rectangle r1 = new Rectangle(0, 0, 100, 100);
    r1.setFill(lg1);/*from   ww  w. j a  v  a  2 s  . c om*/

    box.getChildren().add(r1);

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    VBox box = new VBox();
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);

    Line line = new Line();
    line.setStartX(0.0f);/*from   w ww  .j  a v a 2s. c om*/
    line.setStartY(0.0f);
    line.setEndX(100.0f);
    line.setEndY(100.0f);

    System.out.println(line.getStartY());

    box.getChildren().add(line);

    stage.setScene(scene);
    stage.show();
}