• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic