how to simulate BACKSPACE key in awt 1.02

Discussion in 'Java' started by Adam Gramowski, Jan 29, 2007.

  1. I need to simulation key pressing (Backspace and DELETE). With
    alphanumeric keys is not a problem (just keyUp and keyDown methods).
    But for any functions keys it's methods keyUp and keyDown are not
    working.
    Adam Gramowski, Jan 29, 2007
    #1
    1. Advertising

  2. On Jan 29, 1:21 pm, "Adam Gramowski" <> wrote:

    Sub: how to simulate BACKSPACE key in awt 1.02

    1) Get a time machine
    2) Travel back 10(?) years to when people
    could actually remember (and cared about)
    Java version 1.02.
    3) Ask them.

    To put that another way, why on earth are you
    attempting to support Java 1.0, in this day and
    age?

    Andrew T.
    Andrew Thompson, Jan 29, 2007
    #2
    1. Advertising

  3. Andrew Thompson <> wrote:
    > On Jan 29, 1:21 pm, "Adam Gramowski" <> wrote:
    > Sub: how to simulate BACKSPACE key in awt 1.02
    > To put that another way, why on earth are you
    > attempting to support Java 1.0, in this day and
    > age?


    Is awt version numbering indeed synchronous to
    Java version numbering?

    Even if, there might be reasons...
    Perhaps browser-applets that are required
    to be runnable even on very old browsers/plugins...

    PS: sorry don't know a real answer, either.
    Andreas Leitgeb, Jan 29, 2007
    #3
  4. On Jan 30, 3:03 am, Andreas Leitgeb <>
    wrote:
    > Andrew Thompson <> wrote:
    > > On Jan 29, 1:21 pm, "Adam Gramowski" <> wrote:
    > > Sub: how to simulate BACKSPACE key in awt 1.02


    > > To put that another way, why on earth are you
    > > attempting to support Java 1.0, in this day and
    > > age?

    ...
    >...Is awt version numbering indeed synchronous to
    > Java version numbering?


    Yes. Or rather, AWT is part of the J2SE, and
    gets its 'version number' from that.

    > Even if, there might be reasons...
    > Perhaps browser-applets that are required
    > to be runnable even on very old browsers/plugins...


    The only 'old' (pre 1.3) JVM of any note that
    might reasonably* be encountered in this
    day and age is the MSVM.

    The best thing that we as developers can
    do for users of the MSVM (being obsolete
    and a continuing source of potential security
    problems) is encourage them to update to
    1.2+ (may as well aim for 1.6).

    Note though, that even the MSVM could
    support Java *1.1*.

    Andrew T.
    Andrew Thompson, Jan 29, 2007
    #4
  5. Andrew Thompson <> wrote:
    >> > To put that another way, why on earth are you
    >> > attempting to support Java 1.0, in this day and
    >> > age?

    >> Even if, there might be reasons...
    >> Perhaps browser-applets that are required
    >> to be runnable even on very old browsers/plugins...

    > The only 'old' (pre 1.3) JVM of any note that
    > might reasonably* be encountered in this
    > day and age is the MSVM.


    It was the MSVM that I had vaguely in mind (having believed
    it being even older).

    Just that weekend I talked to someone, who asked me, why
    some banking-homepage (with java) worked for his win98
    machine, and why some other bank's web-access complained
    about "non-existant or disabled java support" on the
    very same machine without any reconfiguration inbetween.
    My guess was, that perhaps the latter bank required a newer
    version than he had installed. (he could rule out security-
    zone reasons - he actually isn't exactly computer-illiterate.)

    It's just for this recent talk that I even cared to answer
    in this thread :)
    Andreas Leitgeb, Jan 29, 2007
    #5
  6. On Jan 30, 4:30 am, Andreas Leitgeb <>
    wrote:
    ....
    > Just that weekend I talked to someone, who asked me, why
    > some banking-homepage (with java) worked for his win98
    > machine, and why some other bank's web-access complained
    > about "non-existant or disabled java support"


    I take it that you (or possibly the person who
    told you) paraphrased that message? It is not
    one I am immediately fmailiar with.

    >...on the
    > very same machine without any reconfiguration inbetween.
    > My guess was, that perhaps the latter bank required a newer
    > version than he had installed.


    (shrugs) Perhaps the second applet used pop-ups,
    and the message was from a JS based checker.
    (Which leads to..)

    >...(he could rule out security-
    > zone reasons - he actually isn't exactly computer-illiterate.)


    I have dealt with problems related to Java applets
    that came down to a *developer* who had forgotten
    that he had installed a pop-up blocker.

    >From a slightly different direction, I myself could

    not figure why some of the web site pages I was
    designing were missing an entire section, until I
    realised that Norton was on 'suppress ads' mode
    and *rewrote* incoming HTML to remove any div's
    that were of class 'ad' (how clever and obscure
    is that?).

    My point is simply that unless I had detailed
    information about the machine, browsers, installed
    software (etcetera), I would not feel confident to
    make *any* predictions about why a particular
    applet or web page was acting in unexpected ways.

    There are too many variables.

    BTW - I hope the OP pops back by, I am
    extremely curious as to why they want to
    support 1.0.

    Andrew T.
    Andrew Thompson, Jan 29, 2007
    #6
  7. OK - thanks everybody for thinking about this problem.
    I resolve it by myself:

    If You want to simulate press alphanumeric key You can do like this:
    Component c;
    char a;
    ....
    c.keyDown(new Event(c,0,c),a);
    c.keyUp(new Event(c,0,c),a);

    but if You want to simulate some function key (for example DELETE
    key), You must use for example:
    c.postEvent(new Event(c,0,Event.KEY_PRESS,215,127,Event.BACK_SPACE,
    0,null));
    c.postEvent(new Event(c,0,Event.KEY_RELEASE,215,127,Event.BACK_SPACE,
    0,null));

    It's working !

    On 29 Sty, 02:21, "Adam Gramowski" <> wrote:
    > I need to simulation key pressing (Backspace and DELETE). With
    > alphanumeric keys is not a problem (just keyUp and keyDown methods).
    > But for any functions keys it's methods keyUp and keyDown are not
    > working.
    Adam Gramowski, Jan 29, 2007
    #7
  8. Andrew Thompson <> wrote:
    >> about "non-existant or disabled java support"

    > I take it that you (or possibly the person who
    > told you) paraphrased that message?

    Probably paraphrased twice (by him & by me) and
    additionally lost in translation from german to
    something almost but not quite entirely unlike
    english :)

    >> My guess was, that perhaps the latter bank required a newer
    >> version than he had installed.

    > (shrugs) Perhaps the second applet used pop-ups,


    I didn't expect to have a problem solved here about which I
    don't know much myself, and can't even exactly describe the
    symptoms ...
    The only reason I mentioned that person's problem here
    is because I guesstimated it as a version-problem, and
    to avoid those kinds of problems may mean sticking to
    *really* old versions. Even if the problem at hand wasn't
    really a version problem, java-versions down to 1.1 are
    still out in the wild, and depending on who offers a service
    one might have to support those legacies of last millennium.
    Afterall *we* are most probably even older than java 1.0 :)

    > ... until I
    > realised that Norton was on 'suppress ads' mode
    > and *rewrote* incoming HTML to remove any div's
    > that were of class 'ad' (how clever and obscure
    > is that?).


    so, your div's really had "ad" as their class ?
    I'm not very surprised by them being filtered away
    here or there. Looks like the guys at norton saw this
    class being used often enough for ads and rarely enough
    elsewhere to implement that heuristic.

    > My point is simply that unless I had detailed
    > information ...

    Well I didn't, but that didn't stop me from offering a
    *possible* reason (I never claimed it was more than that).
    Often enough these answers already help.
    Andreas Leitgeb, Jan 30, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan
    Replies:
    7
    Views:
    30,212
    cathal_mchale
    May 18, 2009
  2. Robert Mark Bram
    Replies:
    2
    Views:
    5,933
    Robert Mark Bram
    Dec 11, 2003
  3. Joel

    How to simulate a key press?

    Joel, May 12, 2006, in forum: C Programming
    Replies:
    4
    Views:
    604
    doina
    May 12, 2006
  4. GOKU24
    Replies:
    0
    Views:
    137
    GOKU24
    Aug 26, 2003
  5. Robert Nurse
    Replies:
    6
    Views:
    86
    Brandon Blackmoor
    Nov 5, 2004
Loading...

Share This Page