|
||||||||||
|
FUELING INNOVATION
Search
Topical index
Advertisement
|
Java Tip 12: How to make cascading menus in JavaHow to make cascading menus in JavaSummaryBy John D. Mitchell
he plain little Java window that has popped up to annoy you exists for sole purpose of showing you how Cascading Menus work. These are also known as Pull-Right Menus since they open up to the right of their parent. Go click on the File menu and then on its various menu items and their children to see how deep the menu nesting goes. Here is the code for the CascadeApplet applet. It's pretty basic in that all it does is create and then display our Frame. Here is the code for the CascadeMenus subclass of Frame. Basically, it just creates a new Menu rather than another MenuItem whenever it wants to create a cascading menu. Now that you know how to make cascading menus, please use them judiciously. As in my example, it is easy to make things more confusing by using Cascading menus. Also keep in mind that a number of us mouse-jockeys are spastic and therefore have a hard time navigating complicated menu hierarchies with these new-fangled mice. Enjoy! JavaWorld also features a Java Questions & Answers column! Send your Java language questions to javaqa@javaworld.com now. We would also like to pass on your Java Tips to the rest of the Java world. Start writing up your coolest tips and tricks now so that you can send them in -- and be eligible for JavaWorld's "Java Tip of the Week" contest. If your Java tip is chosen as JavaWorld's "Java Tip of the Week," you'll be awarded a prized JavaWorld T-shirt and 10,080 minutes of fame and prestige. Send your Java tips and tricks to javatips@javaworld.com.
|
||||||||||||||||||
|
|
||||||||||||||||||
|
(c) Copyright ITworld.com, Inc., an IDG Communications company
Feedback: jweditors@javaworld.com