Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

No focus in JFrame fro JDialog  RSS feed

 
Alejandro Barrero
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating and running (setting visible) a JFrame from a JDialog, but the frame doesn't get any events, keys or mouse. When I click anywhere on the frame I get the Windows sound that I am clicking where nothing will happen.
If you can point me to a web page or book to learn how to use the focus manager I will appreciate that too; CORE JFC by Topley and CORE Java from Sun didn't tell me much.

Your help will be appreciated,

Alejandro Barrero
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm betting that your JDialog is a modal dialog, and that as such it will not allow focus to be transferred to a JFrame, even one it creates. If so, your choices are to either create the dialog non-modal, or why not launch another dialog from the first dialog instead of the JFrame? It seems backwards and strange to have a dialog launching a frame.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!