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

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

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

VBox.setSpacing介绍

暂无

代码示例

代码示例来源: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: jfoenixadmin/JFoenix

@Override
public void start(Stage primaryStage) {
  final ToggleGroup group = new ToggleGroup();
  JFXRadioButton javaRadio = new JFXRadioButton("JavaFX");
  javaRadio.setPadding(new Insets(10));
  javaRadio.setToggleGroup(group);
  JFXRadioButton jfxRadio = new JFXRadioButton("JFoenix");
  jfxRadio.setPadding(new Insets(10));
  jfxRadio.setToggleGroup(group);
  VBox vbox = new VBox();
  vbox.getChildren().add(javaRadio);
  vbox.getChildren().add(jfxRadio);
  vbox.setSpacing(10);
  
  HBox hbox = new HBox();
  hbox.getChildren().add(vbox);
  hbox.setSpacing(50);
  hbox.setPadding(new Insets(40, 10, 10, 120));
  Scene scene = new Scene(hbox);
  primaryStage.setScene(scene);
  primaryStage.setWidth(500);
  primaryStage.setHeight(400);
  primaryStage.setTitle("JFX RadioButton Demo ");
  scene.getStylesheets()
    .add(RadioButtonDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
  primaryStage.show();
}

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

box.getChildren().add(pane);
box.getChildren().add(listsPane);
box.setSpacing(40);

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

main.setSpacing(50);

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

@Override
public void start(Stage stage) {
  JFXSlider horLeftSlider = new JFXSlider();
  horLeftSlider.setMinWidth(500);
  JFXSlider horRightSlider = new JFXSlider();
  horRightSlider.setMinWidth(500);
  horRightSlider.setIndicatorPosition(IndicatorPosition.RIGHT);
  JFXSlider verLeftSlider = new JFXSlider();
  verLeftSlider.setMinHeight(500);
  verLeftSlider.setOrientation(Orientation.VERTICAL);
  JFXSlider verRightSlider = new JFXSlider();
  verRightSlider.setMinHeight(500);
  verRightSlider.setOrientation(Orientation.VERTICAL);
  verRightSlider.setIndicatorPosition(IndicatorPosition.RIGHT);
  HBox hbox = new HBox();
  hbox.setSpacing(450);
  hbox.getChildren().addAll(verRightSlider, verLeftSlider);
  VBox vbox = new VBox();
  vbox.getChildren().addAll(horRightSlider, horLeftSlider, hbox);
  vbox.setSpacing(100);
  vbox.setPadding(new Insets(100, 50, 50, 150));
  Scene scene = new Scene(new Group());
  ((Group) scene.getRoot()).getChildren().add(vbox);
  scene.getStylesheets().add(SliderDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
  stage.setScene(scene);
  stage.setWidth(900);
  stage.setHeight(900);
  stage.show();
  stage.setTitle("JFX Slider Demo");
}

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

pane.setSpacing(30);
pane.setStyle("-fx-background-color:WHITE;-fx-padding:40;");

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

vbox.setSpacing(5);
vbox.setPadding(new Insets(10, 0, 0, 10));
vbox.getChildren().addAll(label, table);

代码示例来源:origin: speedment/speedment

@Override
protected Node createUndecoratedEditor() {
  final VBox container = new VBox();
  
  final ListView<String> listView = new ListView<>(strings);
  listView.setCellFactory(view -> new EnumCell(strings));
  listView.setEditable(true);
  listView.setMaxHeight(USE_PREF_SIZE);
  listView.setPrefHeight(LIST_HEIGHT);
  final HBox controls = new HBox(SPACING);
  controls.setAlignment(Pos.CENTER);
  controls.getChildren().addAll(
    addButton(listView),
    removeButton(listView),
    populateButton(listView)
  );
  container.setSpacing(SPACING);
  container.getChildren().addAll(listView, controls);
  hideShowBehaviour(container);
  
  return container;
}

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

vbox.setSpacing(5);
vbox.setPadding(new Insets(10, 10, 10, 10));
vbox.getChildren().addAll(label, table, actionTaken);

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

pane.setSpacing(30);
pane.setStyle("-fx-background-color:WHITE");

代码示例来源:origin: speedment/speedment

box.setSpacing(8);

代码示例来源:origin: org.jfxtras/jfxtras-common

/**
 * 
 * @param value
 * @return
 */
public VBox withSpacing(double value)
{
  super.setSpacing(value);
  return this;
}

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

public DefaultSimpleDialog(int spacing) {
  this(false);
  box.setSpacing(spacing);
}

代码示例来源:origin: com.cedarsoft.commons/javafx

@Nonnull
public static VBox vbox(@px int spacing, @Nonnull Pos alignment, @Nonnull Node... nodes) {
 VBox vBox = new VBox(nodes);
 vBox.setSpacing(spacing);
 vBox.setAlignment(alignment);
 return vBox;
}

代码示例来源:origin: io.github.factoryfx/javafxDataEditing

private Node addTitle(Node node, String title){
  VBox vBox = new VBox();
  vBox.setSpacing(3);
  Label label = new Label(title);
  label.getStyleClass().add("titleLabel");
  vBox.getChildren().add(label);
  VBox.setVgrow(node, Priority.ALWAYS);
  vBox.getChildren().add(node);
  return vBox;
}
public void updateMergeDiff(MergeDiffInfo<?> mergeDiff) {

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * Generates a vbox with border radius corner and white background.
 */
public static VBox vboxContainer(boolean hgrow, boolean vgrow) {
 final VBox container = new VBox();
 container.setSpacing(10);
 container.getStyleClass().add(ROWS_CONTAINER_CSS);
 if (hgrow) {
  setHgrow(container);
 }
 if (vgrow) {
  setVgrow(container);
 }
 return container;
}

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

@Override
public void start(Stage primaryStage) throws Exception{
  method();
}

private void method(){
  StackPane stack = new StackPane();
  Scene scene = new Scene(stack, 400, 400);
  Beginning.setScene(scene);
  Beginning.setTitle("Start here");

  VBox rows = new VBox();
  rows.setAlignment(Pos.CENTER);
  rows.setSpacing(50);
  stack.getChildren().add(rows);
  // and so one
}

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

VBox vb = new VBox();
vb.getChildren().addAll(tuitionreport,totStudents,totalFees);
vb.setSpacing(10);

VBox vbez = new VBox();
vbez.getChildren().addAll(vb,instructors,hboxtitle);

for(int m=0;m<test.length;m++) {
 HBox hb = new HBox();

 System.out.println("Test.length's size : " + test.length);
 System.out.println("TeacherLabels's count : " + teacherlabels.size());
 hb.getChildren().addAll(teacherlabels.get(m),eachlecturertotstudents.get(m),subincome.get(m),teacherpayments.get(m));
 hb.setSpacing(10);

 vbez.getChildren().add(hb);

}

vbez.getChildren().addAll(linez,allpaymenta,tuitionincomea);
this.setScene(new Scene(vbez, 2000, 2000));
this.show();

代码示例来源:origin: org.controlsfx/controlsfx

private StackPane createMasker(MaskerPane maskerPane) {
  VBox vBox = new VBox();
  vBox.setAlignment(Pos.CENTER);
  vBox.setSpacing(10.0);
  vBox.getStyleClass().add("masker-center"); //$NON-NLS-1$
  vBox.getChildren().add(createLabel());
  vBox.getChildren().add(createProgressIndicator());
  HBox hBox = new HBox();
  hBox.setAlignment(Pos.CENTER);
  hBox.getChildren().addAll(vBox);
  StackPane glass = new StackPane();
  glass.setAlignment(Pos.CENTER);
  glass.getStyleClass().add("masker-glass"); //$NON-NLS-1$
  glass.getChildren().add(hBox);
  return glass;
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

public Node getContent() {
 final VBox box = new VBox();
 VBox.setVgrow(box, Priority.ALWAYS);
 box.setSpacing(25);
 if (content == null) {
  box.getChildren().addAll(toolbar, new HBox());
 } else {
  box.getChildren().addAll(toolbar, content);
  VBox.setVgrow(content, Priority.ALWAYS);
 }
 return box;
}

相关文章