ploblem in jcheckbox

  • Thread starter yew y via JavaKB.com
  • Start date
Y

yew y via JavaKB.com

i was new in java and i now completed add the checkbox in each node but the
ploblem is i cant click the check box..
what should i do in next step... pls help me thank you..
following is my code

fileTree.setCellRenderer(new DefaultTreeCellRenderer()
{
public Component getTreeCellRendererComponent(JTree tree, Object value,
boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus)
{
super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf,
row, hasFocus);
JCheckBox chk = new JCheckBox();
chk.setContentAreaFilled(false);
chk.setEnabled(true);
//
chk.setBorderPaintedFlat(true);
chk.setOpaque(false);

JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(chk, BorderLayout.WEST);
jPanel.add(this, BorderLayout.EAST);
return jPanel;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

checkbox ploblem pls help!! 15
change icon in jtree 0
TreeCellRenderer 2
[SWING] Problem with JTree 2
Jtree renderers 0
jCheckBox in a Jtable 2
[JTable]with Jtables in cells 1
JTable within JTree 1

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top