Originally posted by Shashidhar Rao:
Hi again,
First of all I am not thinking about Mac machine. What I am thinking is How to create keyboard shortcut to open the popupmenu. For suppose I don't want to use mouse in application I want to open the popupmenu by keyboard.
Can you tell how to do this?
Thanks in advance..
Thats easily done using the popup.show(Component invoker,int x,int y)
You will need to:
1) Override the createRootPane as I mentioned earlier. There you will need to register the key(s) which will trigger the popup
2) This will call a method which should accept the invoker component and the popup to be displayed. For this you will need some kind of mechanism to figure out which component is currently having the focus and the popup menus associated with it
3) You will have to then figure out the x and y coordinates of the currently focused component and then display the popup accordingly.
Hope this helps.
Best of luck.