[4995] in java-interest
mostly events
daemon@ATHENA.MIT.EDU (Prasad Gaitonde)
Thu Jan 25 12:18:02 1996
Date: Thu, 25 Jan 1996 10:02:15 -0500
From: Prasad Gaitonde <pgaitond@tfisys.dlj.com>
To: java-interest@java.sun.com
Consider the following scenario :
A parent container object Frame which contains a number of awt components
like Button, Canvas, Text, Label ... Now if these components are used
directly without subclassing them ( and redefining their handleEvent() ),
events occuring in some of these components like Canvas propagate to the
Frame which is what I would expect, but some events in say Button, TextArea,
Label are gobbled up. So there was no way to determine a mouseMove() over a
Button, or say a mouseDown() on a Label.
Well extending these basic components into a new class and overridding the
handleEvent() also did not seem to help.
Well on a like note, how would one determine a right button mouse click
on a Button? ( A left button gives an Event.ACTION_EVENT ).
Also, I noticed a right button click in a Text Area pops up a context sensitive
menu and a left button click selects/deselects text which is fine and in
keeping with what is expected in that context. But is there any way to
override this behaviour ?
The reason I am asking for some way to override most of this default behaviour
in native components is for scenarios like Context Sensitive help in which
I should be able to handle a mouse down event on a TextArea differently, so
that I could post a help message, or in case of a Button to prevent the
visual appearance of the button being depressed.
So :
+ can someone give a explaination for the component events behaving the way
they are ?
+ Is this peculiar to the Java 1.0 Beta 2 and likely to be fixed in later
versions , or this mechanism there to stay ?
Thanks
Prasad
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com