File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How to close jInternal Frame as soon as focus  moves to any object in the parent JFrame. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to close jInternal Frame as soon as focus  moves to any object in the parent JFrame." Watch "How to close jInternal Frame as soon as focus  moves to any object in the parent JFrame." New topic
Author

How to close jInternal Frame as soon as focus moves to any object in the parent JFrame.

Pratham Jain
Greenhorn

Joined: Jun 20, 2013
Posts: 3
I have a form (JFrame). When I click a button in this frame a new sub form (jInternalFrame) opens.
I need help in understanding how to close the jInternalFrame as soon as it or any of the components from it looses focus.

K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2229
    
    7

Welcome to the Ranch.

Your answer lies in the Event Listeners section of the Swing tutorial. Which event listener is the appropriate one depends on how you define "focus": keyboard, mouse, jinternalframe or something else.

K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

Please BeForthrightWhenCrossPostingToOtherSites (link).


The quieter you are, the more you are able to hear.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to close jInternal Frame as soon as focus moves to any object in the parent JFrame.
 
Similar Threads
Creating modal in JInternalFrame
How to set focus on one of the two JInternalFrame
Putting a JTabbedPane in a JInternalFrame
mnemonics are not getting focus for the menubar
JInternalFrame to get Focus