List of usage examples for javafx.scene.layout HBox getChildren
@Override
public ObservableList<Node> getChildren()
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group()); stage.setTitle("Label Sample"); stage.setWidth(400);//w w w .j a v a 2 s.c om stage.setHeight(180); HBox hbox = new HBox(); Label label1 = new Label("Search"); label1.setRotate(270); hbox.setSpacing(10); hbox.getChildren().add((label1)); ((Group) scene.getRoot()).getChildren().add(hbox); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group()); stage.setTitle("Label Sample"); stage.setWidth(400);//from w w w . j ava 2 s . c o m stage.setHeight(180); HBox hbox = new HBox(); Label label1 = new Label("Search"); label1.setTranslateY(50); hbox.setSpacing(10); hbox.getChildren().add((label1)); ((Group) scene.getRoot()).getChildren().add(hbox); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 300, 150); stage.setScene(scene);/*from ww w. j a va2s . co m*/ stage.setTitle("Progress Controls"); for (int i = 0; i < values.length; i++) { final Label label = labels[i] = new Label(); label.setText("progress:" + values[i]); final ProgressBar pb = pbs[i] = new ProgressBar(); pb.setProgress(values[i]); final ProgressIndicator pin = pins[i] = new ProgressIndicator(); pin.setProgress(values[i]); final HBox hb = hbs[i] = new HBox(); hb.setSpacing(5); hb.setAlignment(Pos.CENTER); hb.getChildren().addAll(label, pb, pin); } final VBox vb = new VBox(); vb.setSpacing(5); vb.getChildren().addAll(hbs); scene.setRoot(vb); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group()); stage.setWidth(400);/*from w w w.ja va 2s .com*/ stage.setHeight(180); HBox hbox = new HBox(); Label label1 = new Label("Search"); label1.setFont(new Font("Arial", 30)); hbox.setSpacing(10); hbox.getChildren().add((label1)); ((Group) scene.getRoot()).getChildren().add(hbox); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group()); stage.setTitle("Label Sample"); stage.setWidth(400);/*from w w w . ja v a 2 s.c om*/ stage.setHeight(180); HBox hbox = new HBox(); Label label1 = new Label("Search"); label1.setFont(new Font("Arial", 30)); hbox.setSpacing(10); hbox.getChildren().add((label1)); ((Group) scene.getRoot()).getChildren().add(hbox); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group()); stage.setTitle("Label Sample"); stage.setWidth(400);// ww w . j a v a 2 s. c o m stage.setHeight(180); HBox hbox = new HBox(); Label label1 = new Label("Search"); label1.setTextFill(Color.web("#0076a3")); hbox.setSpacing(10); hbox.getChildren().add((label1)); ((Group) scene.getRoot()).getChildren().add(hbox); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group()); stage.setTitle("Label Sample"); stage.setWidth(400);//www. ja v a 2 s .c o m stage.setHeight(180); HBox hbox = new HBox(); Label label1 = new Label("Search"); label1.setTextAlignment(TextAlignment.JUSTIFY); hbox.setSpacing(10); hbox.getChildren().add((label1)); ((Group) scene.getRoot()).getChildren().add(hbox); stage.setScene(scene); stage.show(); }
From source file:org.pdfsam.ui.banner.BannerPane.java
@Inject public BannerPane(BannerButtons buttons, ImageView payoff, @Named("logo32") Image logo) { getStyleClass().add("pdfsam-banner"); current.getStyleClass().add("header-title"); HBox.setHgrow(buttons, Priority.ALWAYS); HBox logoView = new HBox(); logoView.getStyleClass().add("pdfsam-logo"); logoView.getChildren().addAll(new ImageView(logo), payoff); getChildren().addAll(logoView, current, buttons); eventStudio().addAnnotatedListeners(this); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("JavaFX Welcome"); GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER);//from w ww .j a v a 2 s .co m grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(25, 25, 25, 25)); Text scenetitle = new Text("Welcome"); scenetitle.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20)); grid.add(scenetitle, 0, 0, 2, 1); Label userName = new Label("User Name:"); grid.add(userName, 0, 1); TextField userTextField = new TextField(); grid.add(userTextField, 1, 1); Label pw = new Label("Password:"); grid.add(pw, 0, 2); PasswordField pwBox = new PasswordField(); grid.add(pwBox, 1, 2); Button btn = new Button("Sign in"); HBox hbBtn = new HBox(10); hbBtn.setAlignment(Pos.BOTTOM_RIGHT); hbBtn.getChildren().add(btn); grid.add(hbBtn, 1, 4); final Text actiontarget = new Text(); grid.add(actiontarget, 1, 6); btn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { actiontarget.setFill(Color.FIREBRICK); actiontarget.setText("Sign in button pressed"); } }); Scene scene = new Scene(grid, 300, 275); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { Group root = new Group(); Scene scene = new Scene(root, 330, 120, Color.WHITE); BorderPane mainPane = new BorderPane(); root.getChildren().add(mainPane);/* w w w . ja va 2 s.co m*/ final Label label = new Label("Files Transfer:"); final ProgressBar progressBar = new ProgressBar(0); final HBox hb = new HBox(); hb.setSpacing(5); hb.setAlignment(Pos.CENTER); hb.getChildren().addAll(label, progressBar); mainPane.setTop(hb); final Button startButton = new Button("Start"); final Button cancelButton = new Button("Cancel"); final HBox hb2 = new HBox(); hb2.setSpacing(5); hb2.setAlignment(Pos.CENTER); hb2.getChildren().addAll(startButton, cancelButton); mainPane.setBottom(hb2); startButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { startButton.setDisable(true); progressBar.setProgress(0); cancelButton.setDisable(false); copyWorker = createWorker(); progressBar.progressProperty().unbind(); progressBar.progressProperty().bind(copyWorker.progressProperty()); copyWorker.messageProperty().addListener(new ChangeListener<String>() { public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { System.out.println(newValue); } }); new Thread(copyWorker).start(); } }); cancelButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { startButton.setDisable(false); cancelButton.setDisable(true); copyWorker.cancel(true); progressBar.progressProperty().unbind(); progressBar.setProgress(0); System.out.println("cancelled."); } }); primaryStage.setScene(scene); primaryStage.show(); }