wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Component Checking If the Applet Window is Minimized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Component Checking If the Applet Window is Minimized" Watch "Component Checking If the Applet Window is Minimized" New topic
Author

Component Checking If the Applet Window is Minimized

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
I want my custom Awt Components (my own class extending awt.Component) running under Applet be able to tell if the browser window is minimized, put in the background (i.e. no longer the active window) or hidden. I tried Component.isShowing() but it seems that it always return true even if I've minimised the browser window or put it into the background. Is there any other methods I can use?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

You can get hold of the "browser frame" using SwingUtilities.getAncestorOfClass:
I think that adding a WindowListener to that should work.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Component Checking If the Applet Window is Minimized
 
Similar Threads
How to get handle of the window running the applet?
Maximizing Applet window with shortcut key
JApplet -- Pls help!!
Need urgent Help - Browser is hanging
How to catch browser minimized event