hello
i think this is because the components are overlapped so you can add them by using any layout like this
import javax.swing.*;
import java.awt.*;
public class test2
{
public static void main(String[] args)
{
JLabel label = new JLabel("A Very Simple Text Label");
JRadioButton txt = new JRadioButton("t1",false);
JRadioButton t1 = new JRadioButton("t2",false);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
frame.getContentPane().add(label,BorderLayout.NORT H); // adds to CENTER
frame.getContentPane().add(txt,BorderLayout.CENTER );
frame.getContentPane().add(t1,BorderLayout.SOUTH);
frame.pack();
frame.setVisible(true);
}
}
ok take care
HumaMunir
|