Java Code Examples for javafx.scene.control.DialogPane#setMinSize()

The following examples show how to use javafx.scene.control.DialogPane#setMinSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UIMenuItemTestBase.java    From tcMenu with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
protected void init(Stage stage) {
    manager = mock(CodePluginManager.class);
    ConfigurationStorage storage = mock(ConfigurationStorage.class);
    editorUI = new CurrentProjectEditorUIImpl(manager, stage, mock(EmbeddedPlatforms.class),
            mock(ArduinoLibraryInstaller.class), storage);
    menuTree = TestUtils.buildCompleteTree();
    mockedConsumer = mock(BiConsumer.class);
    this.stage = stage;

    dialogPane = new DialogPane();
    dialogPane.setMinSize(500, 500);
    stage.setScene(new Scene(dialogPane));
}
 
Example 2
Source File: PasswordDialog.java    From phoebus with Eclipse Public License 1.0 5 votes vote down vote up
/** @param title Title, message
 *  @param correct_password Password to check
 */
public PasswordDialog(final String title, final String correct_password)
{
    this.correct_password = correct_password;
    final DialogPane pane = getDialogPane();

    pass_entry.setPromptText(Messages.Password_Prompt);
    pass_entry.setMaxWidth(Double.MAX_VALUE);

    HBox.setHgrow(pass_entry, Priority.ALWAYS);

    pane.setContent(new HBox(6, pass_caption, pass_entry));

    pane.setMinSize(300, 150);
    setResizable(true);

    setTitle(Messages.Password);
    setHeaderText(title);
    pane.getStyleClass().add("text-input-dialog");
    pane.getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);

    // Check password in dialog?
    if (correct_password != null  &&  correct_password.length() > 0)
    {
        final Button okButton = (Button) pane.lookupButton(ButtonType.OK);
        okButton.addEventFilter(ActionEvent.ACTION, event ->
        {
            if (! checkPassword())
                event.consume();
        });
    }

    setResultConverter((button) ->
    {
        return button.getButtonData() == ButtonData.OK_DONE ? pass_entry.getText() : null;
    });

    Platform.runLater(() -> pass_entry.requestFocus());
}