本文整理了Java中javafx.scene.control.Button.setCancelButton()
方法的一些代码示例,展示了Button.setCancelButton()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setCancelButton()
方法的具体详情如下:
包路径:javafx.scene.control.Button
类名称:Button
方法名:setCancelButton
暂无
代码示例来源:origin: torakiki/pdfsam
private Button buildCancelButton(String text, boolean response) {
Button button = buildButton(text, response);
button.setCancelButton(true);
return button;
}
代码示例来源:origin: stackoverflow.com
Button buttonTwo = (Button) alert.getDialogPane().lookupButton(buttonTypeTwo);
buttonTwo.setDefaultButton(true);
Button buttonThree = (Button) alert.getDialogPane().lookupButton(buttonTypeThree);
buttonThree.setCancelButton(true);
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.dialogs
/**
* Create a button for the button bar
*
* @param type
* the button id
* @param label
* the label
* @param defaultOkButton
* <code>true</code> if it is the default button {@link Button#defaultButtonProperty()}
* @param defaultCancel
* <code>true</code> if it is the cancel button {@link Button#cancelButtonProperty()}
* @return the button
*/
protected Button createButtonForBar(final int type, String label, boolean defaultOkButton, boolean defaultCancel) {
Button b = new Button(label);
b.setDefaultButton(defaultOkButton);
b.setCancelButton(defaultCancel);
b.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
buttonPressed(type);
}
});
return b;
}
代码示例来源:origin: org.netbeans.html/net.java.html.boot.fx
box.getChildren().addAll(text, buttons);
dialogStage.setScene(new Scene(box));
ok.setCancelButton(false);
cancel.setCancelButton(true);
cancel.setOnAction(new CloseDialogHandler(dialogStage, null));
dialogStage.centerOnScreen();
代码示例来源:origin: org.netbeans.html/net.java.html.boot.fx
@Override
public void handle(WebEvent<String> t) {
final Stage dialogStage = new Stage();
dialogStage.initModality(Modality.WINDOW_MODAL);
dialogStage.initOwner(owner);
ResourceBundle r = ResourceBundle.getBundle("org/netbeans/html/boot/fx/Bundle"); // NOI18N
dialogStage.setTitle(r.getString("AlertTitle")); // NOI18N
final Button button = new Button(r.getString("AlertCloseButton")); // NOI18N
final Text text = new Text(t.getData());
VBox box = new VBox();
box.setAlignment(Pos.CENTER);
box.setSpacing(10);
box.setPadding(new Insets(10));
box.getChildren().addAll(text, button);
dialogStage.setScene(new Scene(box));
button.setCancelButton(true);
button.setOnAction(new CloseDialogHandler(dialogStage, null));
dialogStage.centerOnScreen();
dialogStage.showAndWait();
}
});
代码示例来源:origin: org.netbeans.html/net.java.html.boot.fx
box.getChildren().addAll(text, line, buttons);
dialogStage.setScene(new Scene(box));
ok.setCancelButton(false);
cancel.setCancelButton(true);
cancel.setOnAction(new CloseDialogHandler(dialogStage, null));
dialogStage.centerOnScreen();
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.dialogs
cancelButton.setCancelButton(true);
cancelButton.setOnAction((event) -> {
task.cancel();
代码示例来源:origin: com.aquafx-project/aquafx
cancel.setCancelButton(true);
hbox.getChildren().add(cancel);
代码示例来源:origin: comtel2000/fx-experience
cancelButton.setCancelButton(true);
代码示例来源:origin: org.apidesign.html/boot-fx
@Override
public void handle(WebEvent<String> t) {
final Stage dialogStage = new Stage();
dialogStage.initModality(Modality.WINDOW_MODAL);
dialogStage.setTitle("Warning");
final Button button = new Button("Close");
final Text text = new Text(t.getData());
VBox box = new VBox();
box.setAlignment(Pos.CENTER);
box.setSpacing(10);
box.setPadding(new Insets(10));
box.getChildren().addAll(text, button);
dialogStage.setScene(new Scene(box));
button.setCancelButton(true);
button.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
dialogStage.close();
}
});
dialogStage.centerOnScreen();
dialogStage.showAndWait();
}
});
内容来源于网络,如有侵权,请联系作者删除!