javafx.scene.layout.VBox.getChildren()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中javafx.scene.layout.VBox.getChildren()方法的一些代码示例,展示了VBox.getChildren()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VBox.getChildren()方法的具体详情如下:
包路径:javafx.scene.layout.VBox
类名称:VBox
方法名:getChildren

VBox.getChildren介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

private VBox createStackedTitledPanes() {
 final VBox stackedTitledPanes = new VBox();
 stackedTitledPanes.getChildren().setAll(
  new TitledPane("Pane 1",  contentNode1),
  new TitledPane("Pane 2",  contentNode2),
  new TitledPane("Pane 3",  contentNode3)
 );
 ((TitledPane) stackedTitledPanes.getChildren().get(0)).setExpanded(true);

 return stackedTitledPanes;
}

代码示例来源:origin: stackoverflow.com

primaryStage.setTitle("Extension Filter Example");
final Label fileLabel = new Label();
Button btn = new Button("Open FileChooser");
btn.setOnAction(new EventHandler<ActionEvent>() {
VBox vBox = new VBox(30);
vBox.getChildren().addAll(fileLabel, btn);
vBox.setAlignment(Pos.BASELINE_CENTER);
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();

代码示例来源:origin: stackoverflow.com

final Label response = new Label();
final ImageView imageView = new ImageView(
 new Image("http://icons.iconarchive.com/icons/gianni-polito/colobrush/128/software-emule-icon.png")
final VBox layout = new VBox(10);
layout.setPrefWidth(300);
layout.setAlignment(Pos.CENTER);
layout.getChildren().addAll(button, response);
layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 20; -fx-font-size: 20;");
stage.setScene(new Scene(layout));

代码示例来源:origin: stackoverflow.com

);
final Label currentRaceStage = new Label();
currentRaceStage.textProperty().bind(
  taskMonitor.currentTaskNameProperty()
final Button startButton = new Button("Start Race");
startButton.disableProperty().bind(taskMonitor.idleProperty().not());
startButton.setOnAction(new EventHandler<ActionEvent>() {
final VBox layout = new VBox(10);
layout.getChildren().setAll(
 raceProgress,
 startButton

代码示例来源:origin: stackoverflow.com

VBox vboxForButtons = new VBox();
for(int i=0; i<10; i++){
  Button btnNumber = new Button();
  btnNumber.setText(String.valueOf(i));
  btnNumber.setOnAction((ActionEvent)->{
    System.out.println(btnNumber.getText());
  });
  vboxForButtons.getChildren().add(btnNumber);
}

代码示例来源:origin: jfoenixadmin/JFoenix

pane.setPadding(new Insets(18));
VBox container = new VBox();
container.getChildren().add(pane);
container.getChildren().add(tabs);
dialog.setScene(customScene);
final EventHandler<KeyEvent> keyEventListener = key -> {
  switch (key.getCode()) {

代码示例来源:origin: stackoverflow.com

VBox buttonHolder = new VBox();
Button button = new Button(...);
buttonHolder.getChildren().add(button);
// repeat as necessary...

buttonHolder.setDisable(true); // all buttons in the VBox will now be disbaled

代码示例来源:origin: jfoenixadmin/JFoenix

@Override
public void start(Stage stage) throws Exception {
  final VBox pane = new VBox();
  pane.setSpacing(30);
  pane.setStyle("-fx-background-color:#EEE; -fx-padding: 40;");
  ToggleButton button = new ToggleButton("JavaFx Toggle");
  pane.getChildren().add(button);
  JFXToggleButton toggleButton = new JFXToggleButton();
  toggleButton.setText("New Skin");
  pane.getChildren().add(toggleButton);
  JFXToggleNode node = new JFXToggleNode();
  final GlyphIcon heartIcon = GlyphsBuilder.create(FontAwesomeIconView.class)
    .glyph(FontAwesomeIcon.HEART)
    .build();
  heartIcon.setStyle("-fx-padding: 10");
  node.setGraphic(heartIcon);
  pane.getChildren().add(node);
  final Scene scene = new Scene(pane, 600, 400, Color.valueOf("#EEE"));
  stage.setTitle("JFX Toggle Button Demo ");
  scene.getStylesheets()
    .add(ToggleButtonDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
  stage.setScene(scene);
  stage.setResizable(false);
  stage.show();
}

代码示例来源:origin: stackoverflow.com

public class CustomGroup extends Group {

  private VBox contentPane = new VBox();

  public CustomGroup() {
    getChildren().add(contentPane);
    contentPane.getChildren().add(new Label("First Label"));
    contentPane.getChildren().add(new Label("Second Label"));
  }

  public void setItems(Node...nodes) {
    contentPane.getChildren().addAll(nodes);
  }

  public ObservableList<Node> getItems() {
    return contentPane.getChildren();
  }

}

代码示例来源:origin: stackoverflow.com

Button b = new Button();
VBox box = new VBox();
box.getChildren().addAll(new Label("line1"), new Label("line2"));
b.setGraphic(box);

代码示例来源:origin: stackoverflow.com

VBox vbox = new VBox();
vbox.getChildren().add(new MyComponent());

代码示例来源:origin: stackoverflow.com

primaryStage.setTitle("AnimationTest");
Pane pane = new Pane();

Rectangle rect = new Rectangle(0,0,100,100);
pane.getChildren().add(rect);
TranslateTransition transition =new TranslateTransition(Duration.millis(1000),rect);
  transition.setByX(100);

Button button = new Button("StartAnimation");
  button.setOnAction((e)->{
    transition.play();
  });
VBox layout = new VBox();
layout.getChildren().addAll(pane, button);
Scene scene = new Scene(layout, 600, 600);
primaryStage.setScene(scene);
primaryStage.show();

代码示例来源:origin: stackoverflow.com

VBox vBox = new VBox();

Button btn1 = new Button("Short");
Button btn2 = new Button("Super Long Button");

btn1.setMaxWidth(Double.MAX_VALUE);
btn2.setMaxWidth(Double.MAX_VALUE);

vBox.getChildren().addAll(btn1, btn2);

代码示例来源:origin: stackoverflow.com

Button configure = new Button("Configure");
changeBackgroundOnHoverUsingBinding(configure);
Button update = new Button("Update");
changeBackgroundOnHoverUsingEvents(update);
VBox layout = new VBox(10);
layout.setAlignment(Pos.CENTER);
layout.setStyle("-fx-padding: 10;");
layout.getChildren().addAll(configure, update);
stage.setScene(new Scene(layout));
stage.show();

代码示例来源:origin: stackoverflow.com

public class SecondStage extends Stage {
Label x = new Label("Second stage");
VBox y = new VBox();

SecondStage(){
  y.getChildren().add(x);
  this.setScene(new Scene(y, 300, 300));
  this.show();
  }    
}

代码示例来源:origin: stackoverflow.com

Label header = new Label("A Prideful Header");
header.getStyleClass().addAll("header");

Label footer = new Label("a humble footer");
footer.getStyleClass().addAll("footer");

VBox box = new VBox();
box.getChildren().addAll(header,footer);

Button button = new Button();
button.setGraphic(box);

代码示例来源:origin: jfoenixadmin/JFoenix

VBox headerPanel = new VBox();
headerPanel.getStyleClass().add("month-year-pane");
headerPanel.setBackground(new Background(new BackgroundFill(this.datePicker.getDefaultColor(),
  Insets.EMPTY)));
headerPanel.setPadding(new Insets(12, 24, 12, 24));
headerPanel.getChildren().add(yearLabelContainer);
headerPanel.getChildren().add(selectedDateContainer);
return headerPanel;

代码示例来源:origin: stackoverflow.com

Popup popup = new Popup();
VBox vBox = new VBox();
for (int i = 0; i < 4; i++)
{
  Button item = new Button("item " + i);
  item.setOnAction(...);
  vBox.getChildren().add(item);
}
ScrollPane scrollPane = new ScrollPane(vBox);
scrollPane.setMaxHeight(500);//Adjust max height of the popup here
scrollPane.setMaxWidth(200);//Adjust max width of the popup here
popup.getContent().add(scrollPane);
popup.show(rootWindow);

代码示例来源:origin: stackoverflow.com

VBox vBox = new VBox();
vBox.setPrefWidth(100);

Button btn1 = new Button("Short");
Button btn2 = new Button("Super Long Button");

btn1.setMinWidth(vBox.getPrefWidth());
btn2.setMinWidth(vBox.getPrefWidth());

vBox.getChildren().addAll(btn1, btn2);

代码示例来源:origin: stackoverflow.com

VBox layout = new VBox();
layout.getChildren().addAll(
  nav,
  webview
stage.setScene(scene);
stage.show();

相关文章