All components have the method show() and setVisible(true) which can be used to display the component. The same is true with JPopupMenu also. But one problem faced while using these two methods is that JMenuItem added to the popup menu may not get the focus and hence will not show as selected when moving the mouse over it.
To resolve this we can use the following method:
show(Component invoker, int x, int y)
No comments:
Post a Comment