Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How Can I Disable Menu-Items?

 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following code to implement an edit menu. For now, I want to be able to control which menu-items are enabled or disabled by implementing the method: menuSelected(MenuEvent).

I thought that I had this working, but now, all of the menu-items are always enabled. (I've tried this with and without implementing an ActionListener interface.




 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
add this to the end of the constructor

addMenuListener(this);
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Michael.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic