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.
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.