mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 15:00:54 +03:00
Demo: fixed placement of dialogs (centered in frame)
This commit is contained in:
@@ -307,9 +307,11 @@ class OptionPanePanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showDialog() {
|
private void showDialog() {
|
||||||
|
Window window = SwingUtilities.windowForComponent( this );
|
||||||
|
|
||||||
if( optionPane.getWantsInput() ) {
|
if( optionPane.getWantsInput() ) {
|
||||||
JOptionPane.showInputDialog(
|
JOptionPane.showInputDialog(
|
||||||
getParent(),
|
window,
|
||||||
optionPane.getMessage(),
|
optionPane.getMessage(),
|
||||||
titleLabel.getText() + " Title",
|
titleLabel.getText() + " Title",
|
||||||
optionPane.getMessageType(),
|
optionPane.getMessageType(),
|
||||||
@@ -318,7 +320,7 @@ class OptionPanePanel
|
|||||||
null );
|
null );
|
||||||
} else {
|
} else {
|
||||||
JOptionPane.showOptionDialog(
|
JOptionPane.showOptionDialog(
|
||||||
getParent(),
|
window,
|
||||||
optionPane.getMessage(),
|
optionPane.getMessage(),
|
||||||
titleLabel.getText() + " Title",
|
titleLabel.getText() + " Title",
|
||||||
optionPane.getOptionType(),
|
optionPane.getOptionType(),
|
||||||
|
|||||||
Reference in New Issue
Block a user