Example usage for javafx.scene.layout Background EMPTY

List of usage examples for javafx.scene.layout Background EMPTY

Introduction

In this page you can find the example usage for javafx.scene.layout Background EMPTY.

Prototype

Background EMPTY

To view the source code for javafx.scene.layout Background EMPTY.

Click Source Link

Document

An empty Background, useful to use instead of null.

Usage

From source file:deincraftlauncher.InstallController.java

@Override
public void initialize(URL url, ResourceBundle rb) {
    instance = this;

    System.out.println("Starting Installer UI...");

    int saveX = 393;
    int cancelY = 165;
    int saveY = 200;
    int sizeX = 481;

    Rectangle separator = new Rectangle();
    separator.setWidth(sizeX);// ww w.  j  a  va  2s. c  om
    separator.setHeight(separatorSizeY);
    separator.setLayoutY(separatorY);
    separator.setFill(blueColor);
    mainPanel.getChildren().add(separator);
    mainPanel.setBackground(Background.EMPTY);

    TextButton cancel = new TextButton(saveX, cancelY, "cancel", Color.RED, mainPanel);
    cancel.setOnClick((TextButton tile) -> {
        cancel();
    });

    save = new TextButton(saveX, saveY, "Weiter", Color.GRAY, mainPanel);
    save.setFocusable(false);
    save.setOnClick((TextButton tile) -> {
        Continue();
    });

    login = new TextButton(14, 151, "Login", Color.BLUE, mainPanel);
    login.setOnClick((TextButton tile) -> {
        doLogin(null);
    });

    Label Title = new Label();
    Title.setText("Installer");
    Title.setPrefSize(sizeX, separatorY);
    Title.setTextFill(Color.WHITESMOKE);
    Title.setTextAlignment(TextAlignment.CENTER);
    Title.setFont(DesignHelpers.getFocusFont(42));
    Title.setAlignment(Pos.CENTER);
    mainPanel.getChildren().add(Title);

    pathLabel.setBackground(new Background(new BackgroundFill(Color.rgb(170, 170, 170), radii, insets)));
    //ContinueButton.setBackground(new Background(new BackgroundFill(Color.rgb(100, 190, 100), radii, insets))); //Green Version

    setDefaultPath();
    System.out.println("starting done");
}

From source file:Jigs_Desktop_Client.GUI.FXMLDocumentController.java

@Override
public void initialize(URL url, ResourceBundle rb) {
    this.alert("resources/app_launch.mp3");
    this.user_name.requestFocus();
    this.btn_logout.setDisable(true);
    this.jc.setStatus(from_user, "online");
    this.my_circle_list.setCellFactory(new Callback<ListView<UserStatus>, ListCell<UserStatus>>() {
        @Override/*w  ww.  j  av a  2  s.c o m*/
        public ListCell<UserStatus> call(ListView<UserStatus> userObj) {
            ListCell<UserStatus> cell = new ListCell<UserStatus>() {
                @Override
                protected void updateItem(UserStatus usrObj, boolean btnl) {
                    super.updateItem(usrObj, btnl);
                    if (usrObj != null) {
                        String filename = usrObj.getStatus();
                        if (filename == null || filename.equals("") || filename.equals("null"))
                            filename = "offline";
                        else
                            System.out.println(filename);
                        Image img = new Image(
                                getClass().getResource("resources/" + filename + ".png").toExternalForm());
                        ImageView imv = new ImageView(img);
                        setGraphic(imv);
                        setText(usrObj.getUsername());
                    }
                }
            };
            return cell;
        }
    });
    this.main_panel.setBackground(Background.EMPTY);
    this.text_message.setOnKeyPressed(new EventHandler<KeyEvent>() {
        @Override
        public void handle(KeyEvent keyEvent) {
            if (keyEvent.getCode() == KeyCode.ENTER) {
                sendMessage(null);
                keyEvent.consume();
            }
        }
    });
}