Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Applet Focus Problem

843807Oct 1 2002 — edited Oct 1 2002
Hi,

I am facing a strange problem. I am having a applet in IE. This applet has a couple of internal frames. The problem is that when I display a Error Dialog through JOptionPane.showMessageDialog() and click on the OK button the focus goes to the IE window instead of being in the applet. So to bring the focus back to the applet I have to click once inside the applet area or type the TAB key.

How do I make sure that the applet keeps the focus to itself.

Thanks in advance,
Ganesh

Comments

843807
Try this after the click event on the button :
yourcomponent.transferFocus();
yourapplet.requestFocus();

where yourcomponent is the component that contains the OK Button
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 29 2002
Added on Oct 1 2002
1 comment
68 views