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) {
    VBox box = new VBox();
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);

    Line line = new Line();
    line.setStartX(0.0f);/*  w w w.  j  av a 2 s  .co m*/
    line.setStartY(0.0f);
    line.setEndX(100.0f);
    line.setEndY(100.0f);

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

    box.getChildren().add(line);

    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);/*  w w  w  . ja v a  2 s  .c  o m*/
    line.setStartY(0.0f);
    line.setEndX(100.0f);
    line.setEndY(100.0f);

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

    box.getChildren().add(line);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    Text text = new Text("!");
    text.setFont(new Font(40));
    VBox box = new VBox();
    box.getChildren().add(text);//  ww w. j a  va2  s  .c  om
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    stage.setScene(scene);
    stage.show();
    stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
        public void handle(WindowEvent we) {
            System.out.println("Stage is closing");
        }
    });
    stage.close();

}

From source file:Main.java

License:asdf

@Override
public void start(Stage stage) {
    stage.setTitle("TitledPane");
    Scene scene = new Scene(new Group(), 450, 250);
    scene.setFill(Color.GHOSTWHITE);

    TilePane tile = new TilePane();
    tile.setHgap(8);//w ww  .j a va2 s  .  co m
    tile.setPrefColumns(4);
    for (int i = 0; i < 20; i++) {
        tile.getChildren().add(new CheckBox("asdf"));
    }

    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(tile);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

License:asdf

@Override
public void start(Stage stage) {
    stage.setTitle("TitledPane");
    Scene scene = new Scene(new Group(), 450, 250);
    scene.setFill(Color.GHOSTWHITE);

    TilePane tile = new TilePane(0.3, 0.5);
    tile.setHgap(8);//from  w w w  .j av  a  2  s .c om
    tile.setPrefColumns(4);
    for (int i = 0; i < 20; i++) {
        tile.getChildren().add(new CheckBox("asdf"));
    }

    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(tile);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

License:asdf

@Override
public void start(Stage stage) {
    stage.setTitle("TitledPane");
    Scene scene = new Scene(new Group(), 450, 250);
    scene.setFill(Color.GHOSTWHITE);

    TilePane tile = new TilePane(Orientation.VERTICAL);
    tile.setHgap(8);//from   www  .j a v  a 2 s.  c o m
    tile.setPrefColumns(4);
    for (int i = 0; i < 20; i++) {
        tile.getChildren().add(new CheckBox("asdf"));
    }

    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(tile);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    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);
    // A rectangle filled with a linear gradient with a translucent color.
    Rectangle rectangle = new Rectangle();
    rectangle.setX(50);//from   ww  w . ja  va2  s .c  om
    rectangle.setY(50);
    rectangle.setWidth(100);
    rectangle.setHeight(70);

    LinearGradient cycleGrad = new LinearGradient(50, // start X
            50, // start Y
            70, // end X
            70, // end Y
            false, // proportional
            CycleMethod.REFLECT, // cycleMethod
            new Stop(0f, Color.rgb(21, 25, 0, .784)), new Stop(1.0f, Color.rgb(0, 210, 0, .784)));
    rectangle.setFill(cycleGrad);

    box.getChildren().add(rectangle);

    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);
    // A rectangle filled with a linear gradient with a translucent color.
    Rectangle rectangle = new Rectangle();
    rectangle.setX(50);//  w w  w.j a  v a  2 s.com
    rectangle.setY(50);
    rectangle.setWidth(100);
    rectangle.setHeight(70);

    LinearGradient linearGrad = new LinearGradient(0, // start X 
            0, // start Y
            0, // end X
            1, // end Y
            true, // proportional
            CycleMethod.NO_CYCLE, // cycle colors
            // stops
            new Stop(0.1f, Color.rgb(25, 200, 0, .4)), new Stop(1.0f, Color.rgb(0, 0, 0, .1)));
    rectangle.setFill(linearGrad);

    box.getChildren().add(rectangle);

    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);

    Light.Distant light = new Light.Distant();
    light.setAzimuth(-135.0);//from  w ww.ja v  a  2 s  . c  o m

    Lighting l = new Lighting();
    l.setLight(light);
    l.setSurfaceScale(5.0);

    Text t = new Text();
    t.setText("JavaFX!");
    t.setFill(Color.RED);
    t.setFont(Font.font(null, FontWeight.BOLD, 90));
    t.setX(10.0);
    t.setY(10.0);
    t.setTextOrigin(VPos.TOP);

    t.setEffect(l);

    box.getChildren().add(t);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    stage.setTitle("TitledPane");
    Scene scene = new Scene(new Group(), 450, 250);
    scene.setFill(Color.GHOSTWHITE);

    TitledPane gridTitlePane = new TitledPane();
    GridPane grid = new GridPane();
    grid.setVgap(4);//from ww w.j  a  v  a 2s  .  c  om
    grid.setPadding(new Insets(5, 5, 5, 5));
    grid.add(new Label("To: "), 0, 0);
    grid.add(new TextField(), 1, 0);
    grid.add(new Label("Cc: "), 0, 1);
    grid.add(new TextField(), 1, 1);
    grid.add(new Label("Subject: "), 0, 2);
    grid.add(new TextField(), 1, 2);
    grid.add(new Label("Attachment: "), 0, 3);
    grid.add(new Label("static value"), 1, 3);
    gridTitlePane.setText("Grid");
    gridTitlePane.setContent(grid);

    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(gridTitlePane);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}