List of usage examples for javax.swing JComponent addMouseListener
public synchronized void addMouseListener(MouseListener l)
From source file:tvbrowser.ui.mainframe.MainFrame.java
private void addContextMenuMouseListener(final JComponent c) { c.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { ContextMenu menu = new ContextMenu(c); menu.show(e.getX(), e.getY()); }//from w w w .j a va2 s . c o m } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { ContextMenu menu = new ContextMenu(c); menu.show(e.getX(), e.getY()); } } }); }