R
RC
I created a popup with JOptionPane, it works fine except I can NOT
resize the popup window.
Here are the codes:
JPanel myPanel = new JPanel();
JOptionPane.showConfirmDialog(null, myPanel,
"Dialog",
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.PLAIN_MESSAGE, null));
Again this works fine except I can NOT resize the popup window
I need to resize the popup dialog window!
I changed in different way
Here are the codes:
JPanel myPanel = new JPanel();
JOptionPane optionPane = new JOptionPane(myPanel, // Object message
JOptionPane.PLAIN_MESSAGE, // messageType
JOptionPane.OK_CANCEL_OPTION); // optionType
JDialog dialog = new JDialog(new JFrame("Chart Manager"),
"Set Chart Properties",
false);
dialog.setContentPane(optionPane);
Now I can resize the popup dialog window
But the new problem come up. When I changed (resize) the
popup dialog window to SMALLER, those OK, Cancel buttons
are gone (disappear)! Order for me see those OK, Cancel
buttons, I need to resize the popup dialog window back to
ORIGAINL size or BIGGER.
Can anyone out there help me make a popup dialog window
resizeble AND keep the OK, Cancel buttons visible in ALL
time?
Thank Q very much in advance!
resize the popup window.
Here are the codes:
JPanel myPanel = new JPanel();
JOptionPane.showConfirmDialog(null, myPanel,
"Dialog",
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.PLAIN_MESSAGE, null));
Again this works fine except I can NOT resize the popup window
I need to resize the popup dialog window!
I changed in different way
Here are the codes:
JPanel myPanel = new JPanel();
JOptionPane optionPane = new JOptionPane(myPanel, // Object message
JOptionPane.PLAIN_MESSAGE, // messageType
JOptionPane.OK_CANCEL_OPTION); // optionType
JDialog dialog = new JDialog(new JFrame("Chart Manager"),
"Set Chart Properties",
false);
dialog.setContentPane(optionPane);
Now I can resize the popup dialog window
But the new problem come up. When I changed (resize) the
popup dialog window to SMALLER, those OK, Cancel buttons
are gone (disappear)! Order for me see those OK, Cancel
buttons, I need to resize the popup dialog window back to
ORIGAINL size or BIGGER.
Can anyone out there help me make a popup dialog window
resizeble AND keep the OK, Cancel buttons visible in ALL
time?
Thank Q very much in advance!