• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JOptionPane.showMessageDialog()

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help.

I have JOptionPane.showMessageDialog(.....) do a sanity check on JTextField(). After I click on OK button on JOptionPane.showMessageDialog(.....), the JOptionPane.showMessageDialog(.....) should be closed. However, it keeps popping up the JOptionPane.showMessageDialog(.....).

How to make it close, so user can edit the JTextField.

Thanks
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please show us an SSCCE that shows this behaviour, because a JOptionPane dialog doesn't popup unless you tell it to.

Moving to our GUI forum.
 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course the JOptionPane will not pop up unless there is an error on JTextFiled. That is the purpose of using JOptionPane.showMessageDialog.
I intentionally make an error on JTextField, then JOptionPane.showMessageDialog opens. I click on OK button to close the JOptionPane, after that, it
will open the same JOptionPane.showMessageDialog again and the action keep repeating.

Please help. Thanks a lot.


Rob Spoor wrote:Please show us an SSCCE that shows this behaviour, because a JOptionPane dialog doesn't popup unless you tell it to.

Moving to our GUI forum.

 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Please help. Thanks a lot.



So where's that SSCCE?
 
reply
    Bookmark Topic Watch Topic
  • New Topic