Hi all.
I am making a Message Dialog From JOptionPane because i do not want to use some static methods of JOptionPane (JOptionPane.Show ...)
My source codes following :
public static void showMessageDialog(String message) {
JOptionPane optionPane = new JOptionPane();
JDialog dialog = optionPane.createDialog(null, "Message");
optionPane.setMessage(message);
optionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE);
JButton btnOk = new JButton("OK");
optionPane.setOptions(new Object[] { btnOk });
dialog.setVisible(true);
}
It runs well but having a problem. When message is a long text --> JDialog can not show all text, dialog's length does not resize automatically following message's length.
Have a the way to make it ? How to solve ?
Thanks in advance !
Diego
Edited by: ThuCT on Feb 1, 2010 3:28 AM