本文整理匯總了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));
}