Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #276

Re: Listening to Mouse le

From "Oliver Wong" <oliver.wong@THRWHITE.remove-dii-this>
Subject Re: Listening to Mouse le
Message-ID <yuJbh.12412$ed6.508153@weber.videotron.net> (permalink)
Newsgroups comp.lang.java.gui
References <1164917034.541182.108840@j44g2000cwa.googlegroups.com>
Date 2011-04-27 15:26 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui

"James Appleby" <james.w.appleby@gmail.com> wrote in message 
news:1164917034.541182.108840@j44g2000cwa.googlegroups.com...

> public void mouseExited(MouseEvent event) {
> if(event.getComponent().equals(focus)) {
> // Get new frame position, in case it's changed
> Rectangle bounds = focus.getBounds();
> // There is a fuzzy area at the edge of the frame, trim inwards
> // to avoid this
> double minX = bounds.getX()+5;
> double minY = bounds.getY()+25; // Also remove the titlebar height
> double maxX = bounds.getWidth()+bounds.getX()-5;
> double maxY = bounds.getHeight()+bounds.getY()-5;

    These hardcoded numbers you put in, 5, 25, etc., are called "Insets". If 
you want your program to work even when the insets vary (and the insets for 
WinXP using the WinXP theme is different than the insets for WinXP using the 
Win2K theme), then you should call getInsets() on your frame, and use those 
numbers instead of your hardcoded values.

    - Oliver

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Listening to Mouse leavin "James Appleby" <james.appleby@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: Listening to Mouse le "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: Listening to Mouse le "Thomas Kellerer" <thomas.kellerer@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: Listening to Mouse le "James Appleby" <james.appleby@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
    Re: Listening to Mouse le "Oliver Wong" <oliver.wong@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
      Re: Listening to Mouse le "James Appleby" <james.appleby@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000

csiph-web