Re: applet & swing




"Michael" <mbialowas@xxxxxxx> wrote in message
news:oSaGf.355791$tl.139128@xxxxxxxxxxx
Hello all, I had a quick question. Is it possible to put the cursor on a
JTextField as soon as an applet loads? I made an applet that does not
place the cursor in the name JTextField when the applet first loads. The
only way it loads is if I enter in data and press submit; then the cursor
goes inside this textfield upon entering another student. I have tried the
following;
nameText.requestFocus();
thanks in advance.
I haven't messed with focus in an applet in quite a while so my memory is
foggy on this point. However, I *think* the old requestFocus() and related
methods are deprecated and have been since Java 1.3 or thereabouts. Sun came
up with a more bulletproof focus traversal scheme at that point. The new
scheme was explained in the appropriate docs (the ones that come with the
API but aren't _in_ the API, if you know what I mean) but it was a pretty
dense and convoluted document as I recall; luckily, I haven't had any focus
issues in quite a while so I never really had to digest that document.

But it should still be around somewhere; it might even still be present in
the 1.5 API, although I haven't looked. See if you can find it in the 1.5
API; if it's not there, try searching on "focus" at the Sun site
(http://java.sun.com) and you're bound to find it eventually.

Or maybe someone here can point you to a more straightforward discussion of
focus under the new scheme.

--
Rhino


.



Relevant Pages

  • applet & swing
    ... JTextField as soon as an applet loads? ... the cursor in the name JTextField when the applet first loads. ...
    (comp.lang.java.help)
  • Re: applet & swing
    ... JTextField as soon as an applet loads? ... place the cursor in the name JTextField when the applet first loads. ...
    (comp.lang.java.help)
  • Re: [HP 49G] solving linear system with complex coefficents
    ... move the cursor to X line in the main screen of the applet then ... Put your calculator in approximate mode and enter your system like this: ... With the cursor still pointing between the ... pointing between the 2 right brackets. ...
    (comp.sys.hp48)
  • Re: Mac OS X Issue
    ... >> When the applet is loaded an exception is thrown with the error message ... >> Is there no such definition on jdk for Mac? ... API JavaDocs posted. ... is just which Java is in use on the machine where this error occurred. ...
    (comp.lang.java.help)
  • Re: improving Java Applet performance
    ... noticeable delay between the time the page loads and the applet ... I looked at this page with FF3 and IE7, neither gave any warnings or were slow. ... Unlimited Access, Anonymous Accounts, Uncensored Broadband Access ...
    (comp.lang.java.programmer)