Re: Set keyboard focus to Applet when it is loaded



"Andrew Thompson" <andrewthommo@xxxxxxxxx> writes:

Felix Natter wrote:
...
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).

Use an HTML form <input> element for instantaneous
response, an applet needs to looad the VM, then the applet.

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>

This JavaScript is typical of the quality of JS written
by Java programmers. It is horrid.

out of curiosity: what's wrong with this? too inefficient?

greetings,

--
Felix Natter
.



Relevant Pages

  • Re: interesting applet security problem
    ... the Javascript from host 1 ... can make the applet do basically anything the applet is allowed to do, ... like ipfw/ipchains/iptables or a small forwarding server). ...
    (comp.lang.java.security)
  • Re: AccessControlException
    ... Ich habe ein Applet zur Anzeige von MJpeg-Bildern. ... function SetURL() ... Konvention gibt es auch in JavaScript bzw. ECMAScript-Implementationen). ... Ich gehe mal davon aus, dass das nicht Dein richtiger Quelltext ist, ...
    (de.comp.lang.javascript)
  • Scatter/Gather in Java or Javascript & html (Dynamic class loading?)
    ... Javascript for the user interface. ... There is an Applet that has established and authorized a Socket ... Application-specific programmers to load their PAYROLL class into the JVM ...
    (comp.lang.java.programmer)
  • Re: AccessControlException
    ... Ich habe ein Applet zur Anzeige von MJpeg-Bildern. ... function SetURL() ... Konvention gibt es auch in JavaScript bzw. ECMAScript-Implementationen). ... | Java hat in etwa soviel mit JavaScript zu tun, ...
    (de.comp.lang.javascript)
  • Re: Java Applet pulled from VMS Web Server
    ... you're recommending is 1) HTML for paints the screen 2) Applet is activated ... socket->Return to Java Script? ... Ajax uses Javascript to access the Global Exported/Published interface ... Javascript terminology and it must be frustrating for you at times, ...
    (comp.os.vms)