0

Hallo! New in Java, and asking a very stupid question:

Can i change the icon "?" in showInputDialog?

`cause in JOptionPane.X i can do it, like JOptionPane.ERROR_MESSAGE, or JOptionPane.WARNING_MESSAGE.

:mrgreen:

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by Zeithgeist
0

hi zeithgeist , yes we can change icon in showInputDialog

default is : JOptionPane.showMessageDialog(frame,
"Here is Some Text.");

with warning icon : JOptionPane.showMessageDialog(frame,
"Here is Some Text.",
"Inane warning",
JOptionPane.WARNING_MESSAGE);

with error icon : JOptionPane.showMessageDialog(frame,
"Here is Some Text.",
"Inane error",
JOptionPane.ERROR_MESSAGE);

NO icon : JOptionPane.showMessageDialog(frame,
"Here is Some Text.",
"A plain message",
JOptionPane.PLAIN_MESSAGE);

Custom Icon : JOptionPane.showMessageDialog(frame,
"Here is Some Text.",
"Inane custom dialog",
JOptionPane.INFORMATION_MESSAGE,
icon);

0

Thx a LOT. ^^

just a question: why are u writting in default "frame"? I got "null" to show it centered... What is "frame" for?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.