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:

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);

Thx a LOT. ^^

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.