org.grinvin.gui

Class JTabbedPaneMouseListener

Implemented Interfaces:
MouseListener

public class JTabbedPaneMouseListener
extends java.lang.Object
implements MouseListener

Class that listens to mouse clicks on a JTabbedPane and displays a popup menu corresponding to the clicked tab.

Constructor Summary

JTabbedPaneMouseListener(JTabbedPane tabbedPane)
Creates a new instance of JTabbedPaneMouseListener and registers it as listener with tabbedPane.

Method Summary

void
addPopup(Component comp, JPopupMenu popup)
add a popup for the tab corresponding to the Component in the JTabbedpane.
void
mouseClicked(MouseEvent e)
void
mouseEntered(MouseEvent e)
void
mouseExited(MouseEvent e)
void
mousePressed(MouseEvent e)
void
mouseReleased(MouseEvent e)
void
setDefaultPopup(JPopupMenu defaultPopup)
sets the default popup to be shown when the user clicks on a tab with no popup menu or doesn't click on the header of a tab.

Constructor Details

JTabbedPaneMouseListener

public JTabbedPaneMouseListener(JTabbedPane tabbedPane)
Creates a new instance of JTabbedPaneMouseListener and registers it as listener with tabbedPane.

Method Details

addPopup

public void addPopup(Component comp,
                     JPopupMenu popup)
add a popup for the tab corresponding to the Component in the JTabbedpane.

mouseClicked

public void mouseClicked(MouseEvent e)

mouseEntered

public void mouseEntered(MouseEvent e)

mouseExited

public void mouseExited(MouseEvent e)

mousePressed

public void mousePressed(MouseEvent e)

mouseReleased

public void mouseReleased(MouseEvent e)

setDefaultPopup

public void setDefaultPopup(JPopupMenu defaultPopup)
sets the default popup to be shown when the user clicks on a tab with no popup menu or doesn't click on the header of a tab.