custom menu addition

D

Dave-pv

Guest
Comment #1 (more below)
I attempted to add a new menu category "Tools" to an AWT Java application I was attempting to build from XCode's template, and while I'm getting compiler errors, the initial application does start up to a hello world state.

Thanks for any considerations. I am trying to figure this out before I add the methods and more code.
_______________
[Session started at 2006-07-16 16:15:47 -0700.]

appname1 has exited with status 0.
[Session started at 2006-07-16 17:33:44 -0700.]
[LaunchRunner Error] appname1.main(String[]) threw an exception:
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key toolMenu
at java.util.ResourceBundle.getObject(ResourceBundle.java:325)
at java.util.ResourceBundle.getString(ResourceBundle.java:285)
at appname1.addMenus(appname1.java:203)
at appname1.<init>(appname1.java:62)
at appname1.main(appname1.java:335)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at apple.launcher.LaunchRunner.run(LaunchRunner.java:88)
at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)

appname1 has exited with status 0.
[Session started at 2006-07-16 17:44:12 -0700.]

_________________________________
Comment #2
In order to get the code to compile I had to comment out the hotkeys for the custom menu items. And so I think that while Java handles "find" it will not handle the new ones, and so I think the problem is in "import java.util.ResourceBundle;" But I don't know where to find it or modify it...

cutAction = new cutActionClass( resbundle.getString("cutItem"),
KeyStroke.getKeyStroke(KeyEvent.VK_X, shortcutKeyMask) );
copyAction = new copyActionClass( resbundle.getString("copyItem"),
KeyStroke.getKeyStroke(KeyEvent.VK_C, shortcutKeyMask) );
findAction = new findActionClass( resbundle.getString("findItem"),
KeyStroke.getKeyStroke(KeyEvent.VK_F, shortcutKeyMask) );
nextAction = new nextActionClass( resbundle.getString("nextItem") );
// KeyStroke.getKeyStroke(KeyEvent.VK_G, shortcutKeyMask) );

sortAction = new sortActionClass( resbundle.getString("sortItem") );
// KeyStroke.getKeyStroke(KeyEvent.VK_A, shortcutKeyMask) );
mirrorAction = new mirrorActionClass( resbundle.getString("mirrorItem") );
// KeyStroke.getKeyStroke(KeyEvent.VK_M, shortcutKeyMask) );
rotateAction = new rotateActionClass( resbundle.getString("rotateItem") );
// KeyStroke.getKeyStroke(KeyEvent.VK_R, shortcutKeyMask) );
}
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top