Skip to Main Content
Java
book

Java

by Michael Sikora
January 2003
Beginner to intermediate content levelBeginner to intermediate
150 pages
7h 28m
English
Morgan Kaufmann
Content preview from Java
m 8.2 Swing Components
1 ! 3
individual button objects to be of type JRadioButton. Then declare the radio button group
object to be of type ButtonGroup. For example,
JRadioButton agel, age2, age3,
age4;
ButtonGroup ageButton;
Then invoke the javax, swing.ButtonGroup constructor, as follows:
ageButton = new ButtonGroup();
The individual buttons are created using the javax, swing.JRadioButton constructor, for ex-
ample
agel = new JRadioButton("age under 20") ;
The individual buttons are then added to the radio button group using the j avax. swing.Button-
Group. add method, as follows:
ageButton.add(agel);
8.2.5 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Programming

Java Programming

Hari Mohan Pandey
Java Programming

Java Programming

Poornachandra Sarang
JAVA Programming

JAVA Programming

K. Rajkumar
Java 9 for Programmers

Java 9 for Programmers

Paul J. Deitel, Harvey Deitel

Publisher Resources

ISBN: 9781558609099