cancel
Showing results for 
Search instead for 
Did you mean: 

Require to add radio button as ivew property

Former Member
0 Kudos

Hi ,

I have to add two radio buttons in my ivew through code in the JSP page.How do i put these radio button properties in the code .Could anyone please help me on this

thankxs

varsha

Accepted Solutions (0)

Answers (3)

Answers (3)

PradeepBondla
Active Contributor
0 Kudos
PradeepBondla
Active Contributor
0 Kudos

Hi,

u can do it by using swings..

import javax.swing.*;
import java.awt.*;

public class CreateRadioButton{
  public static void main(String[] args) {
    CreateRadioButton r = new CreateRadioButton();
  }

  public CreateRadioButton(){
    JRadioButton Male,Female;
    JFrame frame = new JFrame("Creating a JRadioButton Component");
    JPanel panel = new JPanel();
    ButtonGroup buttonGroup = new ButtonGroup();
    Male = new JRadioButton("Male");
    buttonGroup.add(Male);
    panel.add(Male);
    Female = new JRadioButton("Female");
    buttonGroup.add(Female);
    panel.add(Female);
    Male.setSelected(true);
    frame.add(panel);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(400,400);
    frame.setVisible(true);
  }
}

and also u can do it as shown in below links...

http://www.javafaq.nu/java-article750.html

http://www.devx.com/tips/Tip/12812

http://java.sun.com/docs/books/tutorial/uiswing/components/button.html#radiobutton

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_23207986.html

xxxxxxxxxxxxxxxxxxxxxxxxxx

regards,

Pradeep

Edited by: Armin Reichert on Apr 26, 2008 6:39 PM

Former Member
0 Kudos

hi,

this link will help you.

[http://help.sap.com/saphelp_nw04/helpdata/en/d2/0357425e060d53e10000000a155106/frameset.htm]

Regrads

Trilochan