Does anyone know why, when I create JRadioButtons with just an Icon file, the actual radio buttons no longer appear on screen?? Are my icons perhaps too big (32 x 32)?
Here is the code that creates them, the variables are all declared globally earlier on.
private void addFaces()
{
facePanel = new JPanel(new GridLayout(3, 1));
Icon happyIcon = new ImageIcon("happy.jpg"
Icon apathyIcon = new ImageIcon("indifferent.jpg"
Icon sadIcon = new ImageIcon("sad.jpg"
happyButton = new JRadioButton("Good", happyIcon);
apathyButton = new JRadioButton("Neither", apathyIcon);
sadButton = new JRadioButton("Bad", sadIcon);
faceButtonGroup = new ButtonGroup();
faceButtonGroup.add(happyButton);
faceButtonGroup.add(apathyButton);
faceButtonGroup.add(sadButton);
facePanel.add(happyButton);
facePanel.add(apathyButton);
facePanel.add(sadButton);
}
The facepanel is then added to another JPanel(with a flow layout), which in turn is added to another panel (border layout). The icons and strings appear no problem at all, but the actual radio buttons themselves have disappeared??
Many thanks for any help.
Here is the code that creates them, the variables are all declared globally earlier on.
private void addFaces()
{
facePanel = new JPanel(new GridLayout(3, 1));
Icon happyIcon = new ImageIcon("happy.jpg"
Icon apathyIcon = new ImageIcon("indifferent.jpg"
Icon sadIcon = new ImageIcon("sad.jpg"
happyButton = new JRadioButton("Good", happyIcon);
apathyButton = new JRadioButton("Neither", apathyIcon);
sadButton = new JRadioButton("Bad", sadIcon);
faceButtonGroup = new ButtonGroup();
faceButtonGroup.add(happyButton);
faceButtonGroup.add(apathyButton);
faceButtonGroup.add(sadButton);
facePanel.add(happyButton);
facePanel.add(apathyButton);
facePanel.add(sadButton);
}
The facepanel is then added to another JPanel(with a flow layout), which in turn is added to another panel (border layout). The icons and strings appear no problem at all, but the actual radio buttons themselves have disappeared??
Many thanks for any help.