• Post Reply Bookmark Topic Watch Topic
  • New Topic

Closing jOptionPane and show card?  RSS feed

 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there.

I have a question regarding JOptionPanes. Basically, I have a JOptionPane which gives feedback after a button is clicked. What I would like is for the user to be click the 'OK' button and for a different card to appear after the JOptionPane closes.

So within the action performed method I have something like this:


I'm not sure how to amend the setDefaultCloseOperation method so that it closes the JOptionPane AND change the card, e.g.

Can anyone assist?

Thanks,

Sam.
 
Rob Camick
Ranch Hand
Posts: 2756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you start by reading the Swing tutorial. You can start with "How to Use Dialogs". Once you understand how to use the option pane, then you can try "How to Use Card Layout". Once you understand how to use each separately you can combine then together to solve your problem.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!