@Override public void mouseExited(MouseEvent e) { // Since we registered this listener on the child components of // the JWindow, not the JWindow iteself, we have to be careful. Component source = (Component)e.getSource(); Point p = e.getPoint(); SwingUtilities.convertPointToScreen(p, source); if (!TipWindow.this.getBounds().contains(p)) { ft.possiblyDisposeOfTipWindow(); } }
/** * Compute the bounds in which the user can move the mouse without the * tip window disappearing. */ private void computeTipVisibleBounds() { // Compute area that the mouse can move in without hiding the // tip window. Note that Java 1.4 can only detect mouse events // in Java windows, not globally. Rectangle r = tipWindow.getBounds(); Point p = r.getLocation(); SwingUtilities.convertPointFromScreen(p, textArea); r.setLocation(p); tipVisibleBounds.setBounds(r.x,r.y-15, r.width,r.height+15*2); }
@Override public void mouseExited(MouseEvent e) { // Since we registered this listener on the child components of // the JWindow, not the JWindow iteself, we have to be careful. Component source = (Component)e.getSource(); Point p = e.getPoint(); SwingUtilities.convertPointToScreen(p, source); if (!TipWindow.this.getBounds().contains(p)) { ft.possiblyDisposeOfTipWindow(); } }
public void mouseExited(MouseEvent e) { // Since we registered this listener on the child components of // the JWindow, not the JWindow iteself, we have to be careful. Component source = (Component)e.getSource(); Point p = e.getPoint(); SwingUtilities.convertPointToScreen(p, source); if (!TipWindow.this.getBounds().contains(p)) { ft.possiblyDisposeOfTipWindow(); } }
/** * Compute the bounds in which the user can move the mouse without the * tip window disappearing. */ private void computeTipVisibleBounds() { // Compute area that the mouse can move in without hiding the // tip window. Note that Java 1.4 can only detect mouse events // in Java windows, not globally. Rectangle r = tipWindow.getBounds(); Point p = r.getLocation(); SwingUtilities.convertPointFromScreen(p, textArea); r.setLocation(p); tipVisibleBounds.setBounds(r.x,r.y-15, r.width,r.height+15*2); }
/** * Compute the bounds in which the user can move the mouse without the * tip window disappearing. */ private void computeTipVisibleBounds() { // Compute area that the mouse can move in without hiding the // tip window. Note that Java 1.4 can only detect mouse events // in Java windows, not globally. Rectangle r = tipWindow.getBounds(); Point p = r.getLocation(); SwingUtilities.convertPointFromScreen(p, textArea); r.setLocation(p); tipVisibleBounds.setBounds(r.x,r.y-15, r.width,r.height+15*2); }