import java.awt.*;
import javax.swing.*;
public class Radio_List_Test {
  public static void main(String args[]) {
    JFrame f; JPanel p; ButtonGroup bg; JRadioButton n1,n2;
    JList AList;
    String AniList[] = {"CAT", "RAT", "DOG", "PIG", "DUCK", "EGG", "MILK"};
    Font fn = new Font("Courier New",Font.BOLD,16);
    f = new JFrame("Select Component Test");
    p = new JPanel();
    n1  = new JRadioButton("MALE",true);
    n2  = new JRadioButton("FEMALE");
    n1.setFont(fn);
    n2.setFont(fn);
    bg = new ButtonGroup();
    AList = new JList(AniList);
    AList.setFont(fn);
    AList.setPreferredSize(new Dimension(135,140));
    AList.setVisibleRowCount(5);
    AList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    JScrollPane x = new JScrollPane(AList);
    bg.add(n1);
    bg.add(n2);
    p.add(n1);
    p.add(n2);
    p.add(x);   
    f.add(p);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setSize(230, 200);
    f.setVisible(true);
  }
}