Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2007

Tip: Looking for answers? Try searching our database.

how to simulate BACKSPACE key in awt 1.02

Thread view: 
Adam Gramowski - 29 Jan 2007 02:21 GMT
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.
Andrew Thompson - 29 Jan 2007 06:12 GMT
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.
Andreas Leitgeb - 29 Jan 2007 16:03 GMT
> 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.
Andrew Thompson - 29 Jan 2007 16:51 GMT
On Jan 30, 3:03 am, Andreas Leitgeb <a...@gamma.logic.tuwien.ac.at>
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.
Andreas Leitgeb - 29 Jan 2007 17:30 GMT
>> > To put that another way, why on earth are you
>> > attempting to support Java 1.0, in this day and
[quoted text clipped - 5 lines]
> 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 :-)
Andrew Thompson - 29 Jan 2007 18:06 GMT
On Jan 30, 4:30 am, Andreas Leitgeb <a...@gamma.logic.tuwien.ac.at>
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.
Andreas Leitgeb - 30 Jan 2007 17:29 GMT
>> 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.
Adam Gramowski - 29 Jan 2007 18:24 GMT
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 !

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.