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 grau colored popup come up(all the menu items hidden)
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());
        }
    }
}

just seeing the code of that listener tells us nothing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.