Hello.

--- Karsten Trott <[EMAIL PROTECTED]> wrote:
> Hmms, I think the Robot class is not the right way
> for the problem described.

     Perhaps.  But AFAIK it's the only way.  If anyone
knows otherwise, please feel free to jump in.

> The Robot will move the mouse cursor to the new
> position, that's right, but
> whenever you stop using the Robot and the user is
> pushing the mouse a little
> bit - the cursor is usually going back to the
> original position that it had
> before the move.

     Interesting.  I've tried to replicate this
behavior on both a 486 running JDK 1.4 on Win98 and a
Pentium III running JDK 1.3.1_01 on Win2K; in neither
case did the cursor go back to the position before the
move, even while the user was pushing the mouse a
little bit or even a lot.

> So the move seems not what would be required here.
> Anyways, in my opinion, pointer moves (i.e. to the
> dialog boxes to position
> them over an OK button) should be only done by the
> operating system or the
> window manager.
> I would like to have full control over what the
> mouse pointer is doing on my
> screen (and it should behave in all applications the
> same manner).

     In most cases, I would agree.  And I surely
wouldn't recommend pointer-moving routines in serious
applet development.  But there are at least three
types of applications where the programmer would need
direct control over the mouse position.  The first two
are automated testing and self-running demos, as
specified in the API docs.  The third type involves
games where avatar movement relies on continuous mouse
input; for example, while running in circles around,
say, a flagpole, I don't want my character to stop
rotating just because the cursor reached the screen
bounds; I definitely need some way to control that.

> Nothing is more annoying than having one application
> in which the mouse pointer is
> following the OK buttons of dialogs and in another
> (perhaps even written in
> java) - it is not doing that.

     Sounds pretty cool to me.  :)  But seriously,
careful design of the program (e.g. moving the mouse
pointer only if a boolean variable is set to true,
then setting that variable to false when focus is
lost) should eliminate that concern.  And the Robot
class was designed for a few specialized tasks that
would most likely hold the full attention of the user,
anyway.

> Either you do it in all programs the same way or you
> forget it.

     If the only tool you use is a hammer, then the
whole world will look like a nail.  :)

> Consistency is the goal to success in my opinion.
> Karsten

                              Cromwell


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to