• Post Reply Bookmark Topic Watch Topic
  • New Topic

dialog box problems  RSS feed

 
Simon Berman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I'm quite new to Swing so please have patience if my question is quite basic. I have a swing app in which I am trying to display a dialog box on the selection of the 'Quit' menu item.
So far, I can display the dialog box, but I can't figure out how to dispel the dialog box upon selection of the 'no' button.
Here's my code:

I've tried to affect the win variable from inside the anonymous class but can't. What am I missing here?
All replies are much appreciated.
 
Simon Berman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, no probs, I found a better way of doing it:

Does that seems reasonable to you guys...?
 
Paul Bailey
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simon,
if you want to use your original code you would need to add the
MenuItemActionListener as an actionListener.

then later on in the class

may or may not be right...
[This message has been edited by Paul Bailey (edited November 22, 2000).]
[This message has been edited by Paul Bailey (edited November 22, 2000).]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!