Turn Desktop View Off
by Dinesh Thakur
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class JavaExampleSubMenusInJApplet extends JApplet
  {
    public void init()
      {
        JMenuBar MnuBar = new JMenuBar();
        JMenu Mnu=new JMenu("Sub Menus", true);
        JMenu SbMnu = new JMenu("Cascading Menu", true);
        Mnu.add("Item One");
        Mnu.add("Item two");
        Mnu.add("Item Three");
        Mnu.add("Item Four");
        SbMnu.add("Sub Item One");
        SbMnu.add("Sub Item Two");
        SbMnu.add("Sub Item Three");
        SbMnu.add("Sub Item Four");
        Mnu.add(SbMnu);
        MnuBar.add(Mnu);
        setJMenuBar(MnuBar);
     }
  }
/*<APPLET CODE=JavaExampleSubMenusInJApplet.class  WIDTH=350 HEIGHT=290></APPLET>*/

Menus and Submenus in Java Example