by Dinesh Thakur Category: Swing
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");
/*<APPLET CODE=JavaExampleSubMenusInJApplet.class  WIDTH=350 HEIGHT=290></APPLET>*/

Menus and Submenus in Java Example

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Related Articles