Add the same object in JPopupMenu and JMenuBar

Hello,

Can i do this ?

jMenuBar1.add(jMenuFile);

jMenuFile.add(jMenuItemAdd);

jPopupMenu1.add(jMenuItemAdd);

When i do this my jMenuItemAdd appears only in the jPopupMenu1 and not in jMenuFile. So how can i add same object in many Container ?

sorry for my english and thanks to your response.

[335 byte] By [rasvelnikova] at [2007-11-26 19:16:43]
# 1
No.A component can have only one parent container.
Rodney_McKaya at 2007-7-9 21:30:04 > top of Java-index,Desktop,Core GUI APIs...
# 2
Actions might help you to add the same Action to serveral Menu-Items or Buttons in a Toolbar or whatever you want.How to Use Actions: http://java.sun.com/docs/books/tutorial/uiswing/misc/action.html
the12huntersa at 2007-7-9 21:30:04 > top of Java-index,Desktop,Core GUI APIs...
# 3
Thanks, i will try to clone all my jMenuItem because there have same initialize and listeners in JPopupMenu and JMenuBar. If you see other solutions...Ok i didn't see the last response, i'm going to learn about ActionMessage was edited by: rasvelnikov
rasvelnikova at 2007-7-9 21:30:04 > top of Java-index,Desktop,Core GUI APIs...