• Post Reply Bookmark Topic Watch Topic
  • New Topic

checkbox state in another panel

 
Cathy Song
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have implemented the TreeCellRenderer, such that each node in
my JTree has a checkbox and a label in a JPanel.

Now I am creating a mouse listener for the tree. I can get the
name of the node using TreePath.getLastPathComponent(). But how can
I access the state of the checkbox in the selected node?

Thanks,
Cathy.
[ June 14, 2004: Message edited by: Cathy Song ]
 
Weronpc
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Cathy,

You need to explain a little more, since you have this

TreePath.getLastPathComponent();
why not have this method as well,
TreePath.getButtonState();

Explain little more so I can understand better.

Mike
 
Cathy Song
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mike. But I worked around the problem. I created an object
for each node which holdes the state.

Thanks,Cathy.
 
Weronpc
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cathy,

What is a node? I read about it, it's like some kind of refference to something, something like a pointer in C++? Don't quite understand
 
Cathy Song
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a custom tree model. See this link for more details.
http://www.fawcette.com/javapro/2002_08/magazine/features/bkurniawan/default.aspx

Thanks,
Cathy.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!