Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes enabling & disabling menuitems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic
Author

enabling & disabling menuitems

pankaj saxena
Ranch Hand

Joined: Nov 21, 2009
Posts: 46
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

Joined: Sep 08, 2007
Posts: 3068
    
  33

Can you show us the code please? - The code which is related to the issue you have mentioned.


Mohamed Sanaulla | My Blog
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: enabling & disabling menuitems
 
Similar Threads
JTable shows previous data
enabling & disabling menuitems
JTable -Cut Copy Paste
two applets
ergent! please help!