Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dealing with two JOptionPanes????  RSS feed

 
Karthick Dharani Vidhya
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have displayed a JOptionPane showing "fetching details from DB" (For eg.). If there is some DB Problem, I need to remove the above JOptionPane and show the new one with "Sorry! DB Updation Failed".. How do i do this?(Removing one OptionPane and showing the new one)...
 
Rob Spoor
Sheriff
Posts: 21087
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can simulate a button click of a JOptionPane by setting its value. For instance, to simulate a click on the OK button, it would be

Similarly, replace OK_OPTION with CANCEL_OPTION, YES_OPTION, NO_OPTION or any other value you want to "click" for.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!