Creating Radio Buttons in an Applet Window using Advanced Java Programming

Home  »  Java  »  Advance Java »    Java AWT (Abstract Window ToolKit) »    Radio Buttons

The following program code show how to create a Radio Buttons in Applet Window:




The above code will be stored in the file called RadioButtonTest.java, which on compilation will crate a class file called RadioButton.class. Now compiple this file using below commands in the DOS mode:

C:\>jdk1.4\bin>javac RadioButtonTest.java
C:\>jdk1.4\bin>appletviewer RadioButton.java


"Output of RadioButtonTest.java"


Download Complete Program

  -  


Methods of the CheckboxGroup/RadioButton Object:

Methods
Action
getCheckboxGroup()To access the group of any given check box
setCheckboxGroupto change the group of any given check box
getSelectedCheckboxGets the selected checkbox
setSelectedCheckbox(Checkbox chkbox)Sets the given checkbox as selected




AWT Controls



Label Buttons Check Boxes Radio Buttons
Choice Controls TextFields & Password TextAreas Scrolling Lists Scrollbars




No comments:

Post a Comment