Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to retain focus

 
Amaresh Patra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a Jbutton in JApplet which I have defined as the default button in the init() method itself. When a popup screen comes above it loses the focus and when the popup is closed the Jbutton is not able to get the focus back eventhough in the dispose event of popup I have used requestfocus()/grabfocus() to get the focus back to the original JButton.
All suggestions are welcome
Amaresh
 
Lance Finney
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if this will work for an applet, but putting the requestFocus() call in addNotify() works for Dialogs.
Try code similar to this:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic