Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JCheckBox

 
namal weheragoda
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
anyone can help me to change the icon in check box..?

// jCheckBox1.setDisabledIcon(new ImageIcon("E:\\TestTrials\\checkboxchecked.png"));
// jCheckBox1.setDisabledSelectedIcon(new ImageIcon("E:\\TestTrials\\checkboxchecked.png"));
// jCheckBox1.setRolloverIcon(new ImageIcon("E:\\TestTrials\\checkboxchecked.png"));
// jCheckBox1.setRolloverSelectedIcon(new ImageIcon("E:\\TestTrials\\checkboxchecked.png"));

// jCheckBox1.setIcon(new ImageIcon("E:\\TestTrials\\checkboxchecked.png"));

// jCheckBox1.setSelectedIcon(new ImageIcon("E:\\TestTrials\\checkboxchecked.png") );
// jCheckBox1.setPressedIcon(new ImageIcon("E:\\TestTrials\\checkboxchecked.png") );
//


i tried all this ways. but only

jCheckBox1.setIcon(new ImageIcon("E:\\TestTrials\\checkboxchecked.png"));

this method is working. others are not make change in the UI.

regards.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> anyone can help me to change the icon in check box..?
...
> ... but only ... this method is working.

if it's working, do you still have a problem?
if so, try setting the icon in the JCheckBox constructor

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic