• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Pratham Jain
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3457
14
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please BeForthrightWhenCrossPostingToOtherSites (link).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic