• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTree getSelectionCount() always 0  RSS feed

 
Emili Calonge
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to do a Playlist selector for a program, and I want that when the user clicks the button "search" the system performs a search over the selcted playlist, so I want to add a protection so that the user can't have more than one playlist selected when he clicks the search button, what I have in mind is something like this:



But the problem is that getPlaylists().getSelectionCount() is always returning 0, anybody can tell me why? it also returns 0 if I add



in the Value Changed function.
 
Emili Calonge
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved, instead of getPlaylists().whatever I had to do Playlists.whatever, my mistake.

I've also found that by setting the selection model you can tell the sistem to allow only one node selected.



I hope my mistakes are usefull to someone.
[ December 13, 2005: Message edited by: Emili Calonge ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!