Hi Arun,
1. How to set the icon for this?
2. How to trap the action for "YES" "NO" or "Cancel" button for same? as I am not able to find any action listener.
1. There are various static methods in the JOptionPane class that accept an Icon as a parameter for example:
There are also a constructors which accept an Icon:
2. The static methods generally return int,
String or Object. If you don't use the static methods then you'll have to make a call to getValue() which returns an Object.
A good idea would be to look at the javadocs on JOptionPane. It contains a lot of methods and properties, but isn't as complex as it first looks.
Hope this helps
Michael Morris
SCJP2
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher