Home > Articles > Programming > Java

  • Print
  • + Share This
From the author of

Summary

Whoa! That was a quite a bit of work for a simple menu bar, wasn't it? But look at what we have: A MainMenu class that displays a complete menu with all of the bells and whistles (icons, hot keys, and mnemonics), and that is simple to use in our application. We have the framework for an application that is all wired into our menu and is just waiting for us to start handling window messages!

Here are the Java components you learned about:

  • JMenuItem

  • JCheckBoxMenuItem

  • JRadioButtonMenuItem

  • JMenu

  • JMenuBar

  • JPopupMenu

Furthermore, you learned about an implementation that generates clean and manageable code in the application—dividing the project into manageable components is the most effective way to build a software project. This is by far the most manageable way to implement a menu that I have found, and I use it in large Java applications.

You learned about the Java Look and Feel Graphics Repository, which not only includes graphics, but also defines the hot keys, mnemonics, names, status bar updates, and ToolTips to use with menu and toolbar items. As a subtopic, you also learned how to load images from a Java Archive file (JAR) and the requirements to use one.

  • + Share This
  • 🔖 Save To Your Account