This week's giveaway is in the Testing forum. We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line! See this thread for details.
Hi, I am working on a simple menu and running into a bit of difficulty. I have the menu created and it works well except for one issue, I cannot get the greying out of options to work. Specifically, when I select EDIT / OPTIONS / READ ONLY it should grey out the save/saveas options but instead I get a null pointer exception error. Your advice would be much appreciated. Thanks Now for the code......
I draw your attention to these lines of code. private Action saveAction; private Action saveAsAction; .... // set up Save menu item JMenuItem saveItem = fileMenu.add(new TestAction( "Save" )); // set up Save As menu item JMenuItem saveAsItem = fileMenu.add(new TestAction( "Save As" )); ... saveAction.setEnabled(!readOnlyItem.isSelected()); saveAsAction.setEnabled(!readOnlyItem.isSelected());
Danger, 10,000 volts, very electic .... tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth