Demo: fixed placement of dialogs (centered in frame)

This commit is contained in:
Karl Tauber
2019-09-07 19:13:27 +02:00
parent 0c16914c28
commit 38acaeae36

View File

@@ -307,9 +307,11 @@ class OptionPanePanel
}
private void showDialog() {
Window window = SwingUtilities.windowForComponent( this );
if( optionPane.getWantsInput() ) {
JOptionPane.showInputDialog(
getParent(),
window,
optionPane.getMessage(),
titleLabel.getText() + " Title",
optionPane.getMessageType(),
@@ -318,7 +320,7 @@ class OptionPanePanel
null );
} else {
JOptionPane.showOptionDialog(
getParent(),
window,
optionPane.getMessage(),
titleLabel.getText() + " Title",
optionPane.getOptionType(),