Search in sources :

Example 1 with ButtonBar

use of javafx.scene.control.ButtonBar in project jabref by JabRef.

the class DocumentViewerView method show.

@Override
public void show() {
    FXDialog dialog = new FXDialog(AlertType.INFORMATION, Localization.lang("Document viewer"), false);
    DialogPane dialogPane = (DialogPane) this.getView();
    // Remove button bar at bottom
    dialogPane.getChildren().removeIf(node -> node instanceof ButtonBar);
    dialog.setDialogPane(dialogPane);
    dialog.setResizable(true);
    dialog.show();
}
Also used : DialogPane(javafx.scene.control.DialogPane) ButtonBar(javafx.scene.control.ButtonBar) FXDialog(org.jabref.gui.FXDialog)

Example 2 with ButtonBar

use of javafx.scene.control.ButtonBar in project jgnash by ccavanaugh.

the class SelectAccountSecuritiesDialog method createButtonBar.

private ButtonBar createButtonBar() {
    final ButtonBar buttonBar = new ButtonBar();
    // Create and add the ok and cancel buttons to the button bar
    final Button okButton = new Button(resources.getString("Button.Ok"));
    final Button cancelButton = new Button(resources.getString("Button.Cancel"));
    ButtonBar.setButtonData(okButton, ButtonBar.ButtonData.OK_DONE);
    ButtonBar.setButtonData(cancelButton, ButtonBar.ButtonData.CANCEL_CLOSE);
    buttonBar.getButtons().addAll(okButton, cancelButton);
    okButton.setOnAction(event -> {
        result = true;
        ((Stage) okButton.getScene().getWindow()).close();
    });
    cancelButton.setOnAction(event -> {
        result = false;
        ((Stage) cancelButton.getScene().getWindow()).close();
    });
    return buttonBar;
}
Also used : ButtonBar(javafx.scene.control.ButtonBar) Button(javafx.scene.control.Button) Stage(javafx.stage.Stage)

Aggregations

ButtonBar (javafx.scene.control.ButtonBar)2 Button (javafx.scene.control.Button)1 DialogPane (javafx.scene.control.DialogPane)1 Stage (javafx.stage.Stage)1 FXDialog (org.jabref.gui.FXDialog)1