Java Swing Mouse inInsets(MouseEvent me)

Here you can find the source of inInsets(MouseEvent me)

Description

in Insets

License

Open Source License

Declaration

public static boolean inInsets(MouseEvent me) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Insets;

import java.awt.event.MouseEvent;

import javax.swing.JComponent;

public class Main {
    public static boolean inInsets(MouseEvent me) {
        JComponent comp = (JComponent) me.getComponent();
        Insets insets = comp.getInsets();
        if (me.getX() < insets.left || me.getX() > comp.getSize().width - insets.right || me.getY() < insets.top
                || me.getY() > comp.getSize().height - insets.bottom) {
            return true;
        }/*from w ww. j  av a2  s. c  o m*/
        return false;
    }
}

Related

  1. decorateComponentWithMouseOverCursorChange(final JComponent toDecorate, final int mouseEntered, final int mouseExited)
  2. delegateEventToParent(Component component, MouseEvent e)
  3. disableDoubleMouseClick(Component c)
  4. forwardMouseWheelEvent(JScrollPane target, MouseWheelEvent evt)
  5. getDeepestComponentAt(final MouseEvent aEvent)
  6. installMouseListener(Component cmp, MouseListener mouseListener, boolean removePrevious)
  7. isDoubleClick(MouseEvent evt)
  8. isLeftButtonAndNoModifiers(final MouseEvent event)
  9. isLeftMouseButton(MouseEvent anEvent)