javamate06
asked on
JOptionPane Parameters
The title in the
JOptionPane.showMessageDia log(this," HI");
Will be “Massage” and I think this by default
Can I change the title and the color or the font of the message string = “HI“?
JOptionPane.showMessageDia
Will be “Massage” and I think this by default
Can I change the title and the color or the font of the message string = “HI“?
void javax.swing.JOptionPane.sh owMessageD ialog(Comp onent parentComponent, Object message, String title, int messageType, Icon icon) throws HeadlessException
You can change the title and icon of the message window, but not the fong and color. Font and color are part of the Look And Feel that you are using.
You can change the title and icon of the message window, but not the fong and color. Font and color are part of the Look And Feel that you are using.
ASKER
Thank you...
In the
public static void showMessageDialog(this, "HI", "My title", JOptionPane.INFORMATION_ME SSAGE)
and specifically in
“this”
parameter I have an error which expecting identifier.
Please, how to call this to show the message.
In the
public static void showMessageDialog(this, "HI", "My title", JOptionPane.INFORMATION_ME
and specifically in
“this”
parameter I have an error which expecting identifier.
Please, how to call this to show the message.
this represents the parent window. If you supply a parent, then the showd message will be modal to that parent. If you supply null, that displayed window will not have a parent.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:)
yes you can change the title, you should use this
public static void showMessageDialog(this, "HI", "My title", JOptionPane.INFORMATION_ME
Cheers