Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to add different menuitems to child node

 
sudhakar cheru
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have 2 Swing files 1 is Sync7000_SubChildConfTool.java (main file) and 2nd file is SerialPortSubChild.java. After running the main file SYNC7000 (root node) will display. If i right click on this root node i am getting 4 menu items (Add Serial Channel, Add Optical Channel, Add TCP/UDP Channel, Add Modem Channel) in popup. If i right click on that particular menu item then SerialPortSubChild file will open and after filling this frame i am getting Child node. It is fine up to now. But my problem is if i right click on particular Child node i want to display the menu items like Add Polling Group, Edit Channel, Delete Channel in the popup. Please anyone help me.



 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudhakar,
Welcome to the Ranch.

Very few people if any, will want to try out ~500+ lines of code to find out the solution. The preferred way is for you to post a sscce code which demonstrates your problem.
While you are at it, it might also be a good idea for you to read this.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just going by your description, a solution might be to add all the menuitems to the popup,
then when a node is clicked, if that node does not meet your criteria for edit/delete etc,
set those extra items disabled, or visible(false). note that if you're using mouseListeners,
they'll still fire on disabled items.

[edit]

I'm getting totally fed up with these inconsiderate cross-posters

http://www.java-forums.org/awt-swing/21193-how-add-different-menuitems-child-node.html

personal ignore list +1
 
sudhakar cheru
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you All,

My Problem is Solved.
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
sudhakar cheru
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maneesh,

This is my first experience.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic