Set keyboard focus to Applet when it is loaded
- From: Felix Natter <fnatter@xxxxxxx>
- Date: Fri, 25 Aug 2006 09:48:37 +0200
hi,
I have an applet with a JTextArea and I would like the keyboard focus
to be in that JTextArea as soon as the applet is loaded (so that
the user can immediately start typing).
Currently I do two things (with no success):
1. use javascript to set the focus on the <applet> element:
<body onLoad="document.getElementById('kbapplet').focus()">
....
<applet id="kbapplet" code=".."></applet>
2. call requestFocus() and textarea.requestFocusInWindow()
in the init() method (as well as in windowOpened-handler etc).
thanks in advance!
--
Felix Natter
.
- Follow-Ups:
- Re: Set keyboard focus to Applet when it is loaded
- From: Michael Dunn
- Re: Set keyboard focus to Applet when it is loaded
- From: Andrew Thompson
- Re: Set keyboard focus to Applet when it is loaded
- Prev by Date: Re: Rendering CAD/GIS Data on a Map Canvas
- Next by Date: how to get mouse resolution?
- Previous by thread: Help with a JPanel
- Next by thread: Re: Set keyboard focus to Applet when it is loaded
- Index(es):
Relevant Pages
|