I was looking through manuals and examples but I couldn't find how to put a
ButtonGroup on a Frame. For example:
Frame fr = new Frame();
JRadioButton r1 = new JRadioButton("Dec");
JRadioButton r2 = new JRadioButton("Hex");
JRadioButton r3 = new JRadioButton("Oct");
JRadioButton r4 = new JRadioButton("Bin");
ButtonGroup g1 = new ButtonGroup();
Now - how do I put ButtonGroup on a Frame?
Thanks,
Zalek
Knute Johnson - 03 Apr 2004 19:33 GMT
> I was looking through manuals and examples but I couldn't find how to put a
> ButtonGroup on a Frame. For example:
[quoted text clipped - 13 lines]
>
> Zalek
You don't put the ButtonGroup on the frame just the JButtons. You add
the buttons to the ButtonGroup and that is what makes them act together
as a group.

Signature
Knute Johnson
email s/nospam/knute/
Molon labe...
Andrew Thompson - 04 Apr 2004 08:15 GMT
> I was looking through manuals and examples but I couldn't find how to put a
> ButtonGroup on a Frame. For example:
I think you will find you add the
buttons themselves to a frame.
Check the link in the API docs for
ButtonGroup. That will probably
set you right.

Signature
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Andrew Thompson - 04 Apr 2004 08:17 GMT
> I was looking through manuals and examples but I couldn't find how to put a
> ButtonGroup on a Frame. For example:
That link mentioned last post, in case
you are looking at vastly different JDocs..
<http://java.sun.com/docs/books/tutorial/uiswing/components/button.html#radiobutton>

Signature
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology