-
Popup menu problem
I am creating this Word Processor...for my college project...an i hav this bugging problem,
i have this text area which has a popup menu,this popup menu has a listener(below)..now comming to
the point when i right click the TextArea a gray colored popup come up(all the menu items hidden with gray color)
only when mouse over the popup menu....all the menu itms becomes visible....what is the problem...
class PopupListener extends MouseAdapter {
JPopupMenu popup;
PopupListener(JPopupMenu popupMenu) {
popup = popupMenu;
}
public void mousePressed(MouseEvent e) {
maybeShowPopup(e);
}
public void mouseReleased(MouseEvent e) {
maybeShowPopup(e);
}
public void maybeShowPopup(MouseEvent e) {
if (e.isPopupTrigger()) {
popup.show(e.getComponent(),e.getX(), e.getY());
}
}
}
-
Re: Popup menu problem
Can you make a small complete program that compiles, executes and shows the problem?
Please edit your post and wrap your code with
[code=java]
<YOUR CODE HERE>
[/code]
to get highlighting and preserve formatting.