> like Favourite Menu
> if the user click on a link it will be opened but right click on it
> will open a popupMenu containing MenuItems (open,print...etc)
One way to achieve this is Swing I think, is to define the "pop-up"
behavior you want for your menuItem yourself.
Just because the "Favourite" Menu in IE can behave its way doesn't
mean you can simply do the same thing by using the
standard swing component behavior. The JMenuItem by default, won't pop
up anything by mouse click if you don't define any pop-up for it.
A JMenue, if it's a subMenu in a menu list and it has menuItems(such
as the IE->Favourite->Links), the Links will pop up
its MenuItem when your mouse move onto the "Links". This is standard
Swing behavior.
If you want mouse Pop up when user click on a MenuItem, you need to
addListener:
myMenuItem.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
JOptionPane.showOptionDialog(parent,"confirm
Msg","Confirm Dialog",
JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,
null,myYesNoOptions,"yes");
//Show a dialogWindow maybe
}
});
If you want the MenuItem to popup sth when mouse Right click, you may
addMouseListener on that MenuItem,
and only reponse to Right click by:
if((MouseEvent)me.getButton()==MouseEvent.Button3)
//yourPopUpMenu.show();