As previously alluded to, cascading menus are possible with the AWT by virtue of the fact that Menu extends MenuItem. As we have seen, Menu.add(MenuItem) adds a menu item to a menu. Since a Menu is a MenuItem, the Menu.add(MenuItem) method is perfectly happy to take a Menu as an argument, which it dutifully adds to itself.
import java.awt.*; import java.awt.event.*; public class CascadingTest extends ...