"Fossies" - the Fresh Open Source Software Archive

Member "jacl1.4.1/docs/TclJava/JavaEventParameters.html" (25 Jan 2000, 986 Bytes) of package /linux/misc/old/jacl1.4.1.tar.gz:

Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted raw source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Java Event Parameters


An event callback script can query the event parameters using the java::event command. Usually, there is only one event parameter -- the event object, which stores various information about the event as its properties. For example, when the mouseClicked event occurs inside an AWT Button, the x and y properties of the event object contains the location of the mouse cursor. The following script prints out the location of the mouse cursor:


package require java

set f [java::new java.awt.Frame]
$f setSize 100 100
$f show

java::bind $f mouseClicked {
    puts "mouse click at ([java::event x],[java::event y])"

Copyright © 1997-1998 Sun Microsystems, Inc.