File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding JDialog .

 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I hava a JFrame with a JComboBox and JButton..when i click on this button, im invoking a new class which displays a JDailog with an OK button and a text field.. When i click on the OK button of the JDialog the value in the textfield will get populated on the JComboBox, it works fine . But my issue is, if i close the JDialog using the close button that comes with the JDialog, a null value is getting inserted into the combo box ..why is it so ?? cld anyone tell me how to reslove this ??
im using jdk1.3 , i cant use the setUndecorated() of jdk1.4 to disable the close button of JDialog, i tried
setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
but of no use
Cld any1 help me with me
Thanks
Rajeev
 
Jose Botella
Ranch Hand
Posts: 2120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the user close the JDialog null is returned. Check for this value and place "" instead of it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic