• Post Reply Bookmark Topic Watch Topic
  • New Topic

Conditionalize popup menu for each node in JTree

 
Aaron Ehrensberger
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to show a different list of items based on the node inside a JTree. I know how to show the menu for the whole tree, but can I have multiple menus in the tree...

For example...

Parent > Child 1 > Child 2

Can Parent have a menu that says, "New, Rename" and Child 1 have a menu that says "New, Rename, Delete" and Child 2 have a menu that says "New, Rename, Delete" where delete is grayed out?

How would this be done?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!