I'm using NetBeans, and I've a JFrame
where I added a JPanel
to it using the NetBeans's palette.
I want to add a JRadioButton
manually to that JPanel
, so this is the code I tried in the constructor :
ButtonGroup group = new ButtonGroup();
JRadioButton btn1 = new JRadioButton("btn1 ");
JPanel1.add(btn1);
But when I run that JFrame
I don't see that JRadioButton
anywhere, but it works when I add it using the NetBens's
palette.
How can I solve this problem ?