View Single Post
  #15 (permalink)  
Old 08-06-2007, 08:19 PM
levent levent is offline
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
Check showMessageDialog and showOptionDialog examples here. Each returning an int as the result of the selection. Similarly, you can return an object or just a String or int from your dialogs. This way, you will not need to implement this on your application classes and this implementation will be hidden inside your JDialog implementation.

I am not sure how this is implemented in JDK. You might try looking at the source code of JOptionPane class. I tried to find source code of it but could not find it in a limited time..
Reply With Quote