本文整理汇总了Java中javafx.scene.layout.GridPane.setMargin方法的典型用法代码示例。如果您正苦于以下问题:Java GridPane.setMargin方法的具体用法?Java GridPane.setMargin怎么用?Java GridPane.setMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.GridPane
的用法示例。
在下文中一共展示了GridPane.setMargin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EventLogger
import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
public EventLogger() {
setVisible(false);
setPrefHeight(30);
setPrefWidth(612);
ColumnConstraints column1 = new ColumnConstraints();
column1.setPercentWidth(85);
column1.setHgrow(Priority.SOMETIMES);
ColumnConstraints column2 = new ColumnConstraints();
column2.setPercentWidth(15);
column2.setHgrow(Priority.SOMETIMES);
getColumnConstraints().clear();
getColumnConstraints().addAll(column1, column2);
RowConstraints row = new RowConstraints(10, 40, 40);
row.setVgrow(Priority.SOMETIMES);
getRowConstraints().clear();
getRowConstraints().add(row);
eventLabel = buildEventLabel();
setConstraints(eventLabel, 0, 0);
GridPane.setMargin(eventLabel, new Insets(0, 10, 0, 10));
serverLabel = new Label();
setConstraints(serverLabel, 1, 0);
GridPane.setMargin(serverLabel, new Insets(0, 10, 0, 10));
getChildren().addAll(eventLabel, serverLabel);
}
示例2: makeLayout
import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
protected void makeLayout() {
// top form
form.add(formHeader, 0, 0, 2, 1);
form.add(postOfficeStreetL, 0, 1);
form.add(postOfficeStreet, 1, 1);
form.add(postOfficeCityL, 0, 2);
form.add(postOfficeCity, 1, 2);
form.add(maxTimeL, 0, 3);
form.add(maxTime, 1, 3);
maxTime.setPrefWidth(42);
form.add(genBtn, 0, 4);
container.getChildren().add(form);
GridPane.setMargin(wView, new Insets(20));
container.getChildren().add(wView);
this.getChildren().add(container);
}
示例3: onWindowLoad
import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
public void onWindowLoad() {
TableCellCopyHandler copyHandler = new TableCellCopyHandler(dataTableView);
getAccelerators().put(new KeyCodeCombination(KeyCode.C, KeyCombination.CONTROL_ANY), copyHandler);
getAccelerators().put(new KeyCodeCombination(KeyCode.SPACE, KeyCombination.CONTROL_ANY),
() -> {
if (filterTextField.isFocused()) {
filterTextField.suggestCompletion();
}
});
filterGrid.add(filterTextField, 0, 0);
GridPane.setMargin(filterTextField, new Insets(0, 10, 0, 10));
}