• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

checkbox state in another panel

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't listen to Steve. Just read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic