Advertisement

[java] Help wanted - Menus in Applets

Started by July 24, 2000 12:27 PM
3 comments, last by salvo 24 years, 5 months ago
I have an applet (with no main function) which I want to run with appletviewer or jview (in Windows) and I wan''t to insert a menu. I located a "father" frame to my applet and attached a menubar, menus, menuitems. But I can''t "catch" the events on that frame, since it''s on a higher level than the applet. How can I detect if the user is using the menu?
Just make your frame an ActionListener so that you can trap actionPerformed events.
Advertisement
If you aren''t already, use Swing (or the JFC if you prefer). Just upgrade to Java 1.2. Right now, it isn''t supported in either Netscape or IE except through the plug-in, but is supported by mozilla and the Netscape 6 beta. Also, I believe some other web browsers support it. It''s worth it. You can load images without needing the media tracker, and the improvements to the gui is great.

Creating menus like you are doing won''t work on Macs. However, Swing uses lightweight (as in java-created) menus which not only allow you to use menus on applets, it works on every system.
What''s wrong with the Media Tracker Squidi, I thought that was a great feature to be able to check on the status of a media source''s load time. Sure as hell is handier than not being able to.
Media Tracker doesn''t suck, but it requires more effort to do little things. If I wanted all the extra functionality, it would be great....but I don''t. I just want to load an image.

Image i = new ImageIcons("filename.gif").getImage();

That''s all it takes.

This topic is closed to new replies.

Advertisement