/* * (non-Javadoc) * * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent) */ public void mouseEntered(MouseEvent e) { if (isEnabled()) { if (hoverButton && !pressed) { setBorderType(hoverBorder); if (hoverForeground != null) { super.setForeground(hoverForeground); } if (hoverBackground != null) { super.setBackground(hoverBackground); } itemEvent(true); } } if (toolTipText != null) { ToolTipManager.getInstance().requestToolTip(this, toolTipText); } mouseInComponent = true; }
/* * (non-Javadoc) * * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent) */ public void mouseExited(MouseEvent e) { mouseInComponent = false; if (hoverButton) { if (!pressed) { setBorderType(normalBorder); if (hoverForeground != null) { super.setForeground(normalForeground); } if (hoverBackground != null) { super.setBackground(normalBackground); } itemEvent(true); } } else { if (mouseIsDown) { paint(this.getGraphics()); } } if (toolTipText != null) { ToolTipManager.getInstance().requestToolTip(null, null); } }