Hi Rich,

To get the JCheckBoxes to respond to mouse events, you need to create a 
TreeCellEditor using a JCheckBox and enable editing on the tree.  The mouse 
events will then be send to the editor.

- Brandt Obermeit

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard O. Hammer
Sent: Monday, January 24, 2005 7:22 AM
To: Java Users Group
Subject: [Juglist] JTree question

I am putting JCheckBox(es) in the nodes of a javax.swing.JTree, by implementing 
TreeCellRenderer, but have not succeeded in getting those JCheckBoxes to 
respond to mouse clicks.

Since the getTreeCellRendererComponent() method of TreeCellRenderer returns a 
Component, which can normally be a JPanel containing controls, I figured it was 
fair game to put JCheckBoxes and other controls inside the returned Component.  
But right now it appears that the JTree is capturing the mouse clicks over the 
JCheckBoxes, and my poor JCheckBoxes never even hear about it.

Any suggestions?

Thanks,
Rich Hammer

_______________________________________________
Juglist mailing list
[email protected]
http://trijug.org/mailman/listinfo/juglist_trijug.org

_______________________________________________
Juglist mailing list
[email protected]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to