how to simulate BACKSPACE key in awt 1.02

A

Adam Gramowski

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.
 
A

Andrew Thompson

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.
 
A

Andreas Leitgeb

Andrew Thompson said:
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.
 
A

Andrew Thompson

...
...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.
 
A

Andreas Leitgeb

Andrew Thompson said:
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 :)
 
A

Andrew Thompson

On Jan 30, 4:30 am, Andreas Leitgeb <[email protected]>
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.
 
A

Adam Gramowski

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 !
 
A

Andreas Leitgeb

Andrew Thompson said:
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 :)
(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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top