M
Mickey Segal
One of the advantages of Java is being able to add interactivity to programs
more than is possible with other Web technologies. As an example, an applet
can examine input to a TextField and change the TextField contents to flag
or fix errors. However, this ability is impaired by the way input from
Tablet computers (or external pen/tablets) has been implemented.
Input from Tablet computers to Java TextFields triggers only
textValueChanged events, not Key events (in any reliable or useful way). In
addition, modifying the contents of the TextField using setText also
triggers only textValueChanged events. So if you want input from a Tablet
to TextField to be modified by setText you get into infinite recursion of
textValueChanged calling setText which calls textValueChanged ....
This problem is illustrated with a working applet (without the infinite
recursion), source code, and examples of output at:
http://www.segal.org/java/tablet_events3/
Are there any good solutions other than giving up calling setText from
textValueChanged? Some possible approaches are discussed at the URL above,
but none seem satisfactory. A change in the Java specification to create
new Tablet events or mandate Key events for Tablet input would solve the
problem, but such changes are not easy.
more than is possible with other Web technologies. As an example, an applet
can examine input to a TextField and change the TextField contents to flag
or fix errors. However, this ability is impaired by the way input from
Tablet computers (or external pen/tablets) has been implemented.
Input from Tablet computers to Java TextFields triggers only
textValueChanged events, not Key events (in any reliable or useful way). In
addition, modifying the contents of the TextField using setText also
triggers only textValueChanged events. So if you want input from a Tablet
to TextField to be modified by setText you get into infinite recursion of
textValueChanged calling setText which calls textValueChanged ....
This problem is illustrated with a working applet (without the infinite
recursion), source code, and examples of output at:
http://www.segal.org/java/tablet_events3/
Are there any good solutions other than giving up calling setText from
textValueChanged? Some possible approaches are discussed at the URL above,
but none seem satisfactory. A change in the Java specification to create
new Tablet events or mandate Key events for Tablet input would solve the
problem, but such changes are not easy.