Results 1 to 6 of 6

Thread: Nesting Menus? [Resolved]

Threaded View

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Nesting Menus? [Resolved]

    What's the easiest way to nest Menus? You know create
    submenus. I have somthing like this in one of my programs but
    the last option only get the submenu, im not sure why this is so.

    Code:
       JMenuBar jmb = new JMenuBar(); 
       JMenu options = new JMenu("Options");
       JMenu settings = new JMenu(); 
       JMenu help = new JMenu("Help"); 
       JMenu novice = new JMenu("Novice");
       JMenu inter = new JMenu("Intermedeate"); 
       JMenu advanced = new JMenu("Advanced");
       JRadioButtonMenuItem min1 = new JRadioButtonMenuItem("Min 1");
       JRadioButtonMenuItem min3 = new JRadioButtonMenuItem("Min 3");
       JRadioButtonMenuItem min5 = new JRadioButtonMenuItem("Min 5"); 
    
    
           jmb.add(options);
           jmb.add(help); // add JMenu
           options.add(novice); // add the main JMenus
           options.add(inter);  
           options.add(advanced);
           bg.add(min1); // add JRadioButtonMenuItems too ButtonGroup
           bg.add(min3);
           bg.add(min5);
           settings.add(min1); // add JRadioButtonMenuItems to JMenu
           settings.add(min3);
           settings.add(min5); 
           novice.add(settings); // add JMenu Setting to each JMenu 
           inter.add(settings);
           advanced.add(settings);
    Last edited by Dilenger4; Oct 26th, 2001 at 09:46 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width