Sunday 15 March 2015

swing - How to add a button group of JRadioButtons in a Panel or just JRadioButtons in a panel in Java? -


I am trying to create a restaurant menu and for this reason I am keeping this question because I have 4 panels Using the layout. I have 4 panels, each of which has the name WestPainle, TopPanel, Eastpanel and the bottom panel. I have already made Geradiobutan and put me in the button group. I have created two button groups and I want to put a button group of JRDobutans in the West and the other in the east. Or maybe a jcmobox on the pre-penile. The problem is that when I'm trying to do this method:

eastpanel .add (button group (Named Group), border layout. EAST)

says that this is an error for the buttons group components. Is there any way that I can put the group in the panel or just the button button?

The button group is not a component, so it can not be added to the panel, Need to add.

Your question is not very clear, so I'm not completely sure what you are trying to achieve.

  JPanel buttonspanel = new zpn (); ButtonPailel.Settleout (new box layout (buttonpanel, box layout.LINE_AXIS)); ButtonPanel.add (Radio1); ButtonPanel.add (radio2); Eastpanel.add (Button Panel, Border Layout. EAST)    

No comments:

Post a Comment