Bookmark Topic Watch Topic
  • New Topic

enabling & disabling menuitems

 
pankaj saxena
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Report post to moderator
sir,

I have already used setEnabled() method , but the case is , it is disabling all menuitems but when i call setEnabled(true) then it is not enabling the menuitems.

Moreover, my class hierarchy is like as follows:

1. Module.java : it is a frame that contains two Panels , one panel contains Menubar while second panel is emtpy which i am using to display each page( a panel to take user input) by clicking on menuitem(eg. PersonalDetails).

2. I am declaring , initializing all menuitems in Module.java and on its menuitem click event i call "PersonalDetails.java" and there itself , i disable other menuitems. So far, its working as per me. But, on the display of PersonalDetails class, which contains a GUI form and a "Close "button . On "Close " button event handling i have called setEditable(true) on each menuitem.

It is throwing NullPointerException , since the PersonalDetails class doesn't have anything related to Menuitems, so i want to ask how should i move forward. Do i need to write one Utility class or something else.

thanks.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
Can you show us the code please? - The code which is related to the issue you have mentioned.
 
Rob Spoor
Sheriff
Pie
Posts: 20494
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Once is enough. Please UseOneThreadPerQuestion. I'll close this thread; please use your old thread for this problem.

But I do suggest you follow Mohamed's suggestion - show us some code. In your other thread of course.
    Bookmark Topic Watch Topic
  • New Topic