Icon TaskBar « JCheckBox « Java Swing Q&A





1. Checkbox Icons    coderanch.com

2. Icons in checkbox    coderanch.com

4. Not able to display icon with JCheckBox    java-forums.org

So this is a snippet code I am using: class BarPanel extends JPanel { URL iconURL = Test.class.getResource("caper.jpg"); ImageIcon caper = new ImageIcon(iconURL); JCheckBox check1 = new JCheckBox("Check 1", caper,true); public BarPanel() { setLayout(new FlowLayout()); add(check1); } } The image shows up fine but I can't see a checkbox, only the image icon with the Label. If I define the JCheckBox ...