Swings-PopupMenu

Hi All,

Is there any solution,

I want to disable a menuitem If only some condition is occured.(Condition is in another java file not in Popup construction java file).

Really I am not understanding how to disable.

I know we can do by menuItem.setEnabled(false);

But how to get a control from another java file.

Please help me.

Thanks & regards,

Sowmya

[409 byte] By [Swingsa] at [2007-10-2 6:02:23]
# 1

I am not sure what you mean, but maybe what you need is to have a method that checks the condition and return true or false:

public boolean checkCondition() {

return (condition? true : false);

}

So you just need to create an object (Whatever class it is), call this method and enable/disable the menuitem

Hope that helps

didia at 2007-7-16 13:02:49 > top of Java-index,Desktop,Core GUI APIs...