U can go through the SwingSet2 Demo..
it's (SwingSet2.jar) inside your
<javadir>\demo\jfc\SwingSet2 directory
there u will find all the Swing components demo...
JOptionPane demo is also there (8th column) & every
demo is included with complete source code...