add()
method in java.awt.Menu
that accepts a string as an argument. This string is just the label of the
menu item. This method still creates new MenuItem
objects. It just does it behind your back. Here's how it would be used
Menu editMenu = new Menu("Edit");
editMenu.add("Undo");
editMenu.addSeparator();
editMenu.add("Cut");
editMenu.add("Copy");
editMenu.add("Paste");
editMenu.add("Clear");
editMenu.addSeparator();
editMenu.add("Select All");