Link to home
Start Free TrialLog in
Avatar of perdoname_
perdoname_

asked on

Radiobutton below menubar

Hello Experts,

I have that class [in the code snippet] and i need your assistance how can i add the radiobuttons below the menubar ["File"].

If anyone can be some sort of help it'd be grateful !

Thanks in advance!
public class MsgGUI extends JFrame {
	
	static JRadioButton bascending = new javax.swing.JRadioButton();
	static JRadioButton bdesceding = new javax.swing.JRadioButton();
	static JRadioButton bunsorted = new javax.swing.JRadioButton();
	
	static JPanel panelradio = new JPanel(new GridLayout(100,1));
	
   public static void main(final String s[ ])
   {
      final JFrame frame = new JFrame("GUI!");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setJMenuBar(new MenubarClass());
      frame.pack(  );
      frame.setVisible(true);  
      ScrollList sl = new ScrollList();
      sl.setVisible(true);
      frame.setSize(500, 500);
      panelradio.add(bunsorted);
      panelradio.add(bascending);
      panelradio.add(bdesceding);
    		  
   }
   
   
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of cmalakar
cmalakar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
But don't forget to add these JRadioButtonMenu inside a ButtonGroup!

Or else they won't be mutually exclusive.
Avatar of perdoname_
perdoname_

ASKER

I want to put the radiobuttons BELOW the men bar !
>> I want to put the radiobuttons BELOW the men bar !

JRadioButtonMenuItem is basically used to put the radio button as the menu items...

What does your Below the menu bar means.. ?