Click to See Complete Forum and Search --> : [JFrame] Child frame flash on parent frame focus attempt


Hellboyz
March 18th, 2010, 06:11 PM
I have no clue how to word this but basically how do I make it so when a user tries to click the parent frame of my application they must first dispose of the child frame and when they try to give focus to the parent frame the child frame will flash.

Example: Open Notepad and go to Help >> About Notepad. Now try to click back on Notepad without closing the About Notepad window.

How is the above accomplished and what is it called because I have no clue what to call it and this is as best as I can think of how to word it.


Thanks.

dlorde
March 19th, 2010, 05:46 AM
I'm guessing you need to use a modal dialog (JDialog) for the child frame. This will prevent focus returning to the parent until it is closed.

See How To Make Dialogs (http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html) and How To Use Modality In Dialogs (http://java.sun.com/docs/books/tutorial/uiswing/misc/modality.html).

If you understand what you're doing, you're not learning anything...
Anon.

Hellboyz
March 19th, 2010, 04:32 PM
Worked perfectly. Thank you ;).