本文整理汇总了Java中javafx.scene.control.Button.setCancelButton方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setCancelButton方法的具体用法?Java Button.setCancelButton怎么用?Java Button.setCancelButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.Button
的用法示例。
在下文中一共展示了Button.setCancelButton方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PrescriptionAction
import javafx.scene.control.Button; //导入方法依赖的package包/类
public PrescriptionAction() {
button = new Button();
button0 = new Button();
setSpacing(3.0);
setStyle("-fx-background-color: none;");
getStylesheets().add("/view/common/../../css/main.css");
button.setDefaultButton(true);
button.setMnemonicParsing(false);
button.setOnAction(this::handleEditButton);
button.setText("Edit");
button0.setCancelButton(true);
button0.setMnemonicParsing(false);
button0.setOnAction(this::handleDeleteButton);
button0.setText("Delete");
getChildren().add(button);
getChildren().add(button0);
}
示例2: RecurrencePopupSkin
import javafx.scene.control.Button; //导入方法依赖的package包/类
public RecurrencePopupSkin(RecurrencePopup popup) {
super();
this.popup = popup;
Button okButton = new Button(Messages.getString("RecurrencePopupSkin.OK")); //$NON-NLS-1$
okButton.setDefaultButton(true);
okButton.setOnAction(evt -> {
popup.hide();
popup.fireEvent(
new RecurrencePopupEvent(RecurrencePopupEvent.OK_PRESSED));
});
Button cancelButton = new Button(Messages.getString("RecurrencePopupSkin.CANCEL")); //$NON-NLS-1$
cancelButton.setCancelButton(true);
cancelButton.setOnAction(evt -> {
popup.hide();
popup.fireEvent(
new RecurrencePopupEvent(RecurrencePopupEvent.CANCEL_PRESSED));
});
HBox buttonBox = new HBox();
buttonBox.setAlignment(Pos.CENTER);
buttonBox.getChildren().addAll(cancelButton, okButton);
buttonBox.getStyleClass().add("button-pane"); //$NON-NLS-1$
BorderPane contentPane = new BorderPane();
contentPane.getStyleClass().add("content"); //$NON-NLS-1$
contentPane.setCenter(popup.getRecurrenceView());
contentPane.setBottom(buttonBox);
stackPane = popup.getRoot();
stackPane.getChildren().add(contentPane);
}
示例3: Actions
import javafx.scene.control.Button; //导入方法依赖的package包/类
public Actions() {
columnConstraints = new ColumnConstraints();
columnConstraints0 = new ColumnConstraints();
columnConstraints1 = new ColumnConstraints();
rowConstraints = new RowConstraints();
button = new Button();
button0 = new Button();
button1 = new Button();
setPrefHeight(32.0);
setPrefWidth(186.0);
setStyle("-fx-background-color: none;");
getStylesheets().add("/view/common/../../css/main.css");
columnConstraints.setHgrow(javafx.scene.layout.Priority.SOMETIMES);
columnConstraints.setMaxWidth(120.0);
columnConstraints.setMinWidth(10.0);
columnConstraints.setPrefWidth(95.0);
columnConstraints0.setHgrow(javafx.scene.layout.Priority.SOMETIMES);
columnConstraints0.setMaxWidth(150.0);
columnConstraints0.setMinWidth(10.0);
columnConstraints0.setPrefWidth(100.0);
columnConstraints1.setHgrow(javafx.scene.layout.Priority.SOMETIMES);
columnConstraints1.setMaxWidth(192.0);
columnConstraints1.setMinWidth(10.0);
columnConstraints1.setPrefWidth(110.0);
rowConstraints.setMinHeight(10.0);
rowConstraints.setPrefHeight(30.0);
rowConstraints.setVgrow(javafx.scene.layout.Priority.SOMETIMES);
button.setDefaultButton(true);
button.setMnemonicParsing(false);
button.setOnAction(this::handleEditButton);
button.setText("Edit");
GridPane.setColumnIndex(button0, 1);
button0.setMnemonicParsing(false);
button0.setOnAction(this::handleViewButton);
button0.getStyleClass().add("btn-primary");
button0.setText("View");
GridPane.setColumnIndex(button1, 2);
button1.setCancelButton(true);
button1.setMnemonicParsing(false);
button1.setOnAction(this::handleDeleteButton);
button1.setText("Delete");
getColumnConstraints().add(columnConstraints);
getColumnConstraints().add(columnConstraints0);
getColumnConstraints().add(columnConstraints1);
getRowConstraints().add(rowConstraints);
getChildren().add(button);
getChildren().add(button0);
getChildren().add(button1);
}