[2539] in java-interest
Re: Events and Text widgets
daemon@ATHENA.MIT.EDU (Thomas Ball)
Wed Oct 4 04:47:52 1995
Date: Mon, 2 Oct 1995 16:51:57 -0700
From: Thomas.Ball@Eng.Sun.COM (Thomas Ball)
To: Steven.Wong@Comp.VUW.AC.NZ
Cc: java-interest@java.Eng.Sun.COM
That is one of the known problems with TextField, and it is supposed to
be fixed for beta. I'm also waiting on that change.
Tom
> From daemon@java Mon Oct 2 16:24:55 1995
> To: java-interest@java
> Subject: Events and Text widgets
> X-Url: http://www.comp.vuw.ac.nz/~ninja
> X-Face: ()%8NaeMLdx3iXzhzVdH/=E4y{>3NTSF6KhTAgdZfv\L&(_Y>LPs%SQ>\[a-u#%gM*,k}CQ\/?zQ34>z$j*ff|((\}%^J}79u$n?o7Ys=#K+h6Y\$/lxMn1G7!]>/O^Fnpwm3ujN,y;>>SnS\CT!SEgv(B9.Y)t,!.Vnzin}2g%tDcHGixf,Mb'?G
> Mime-Version: 1.0
> X-Info: To unsubscribe, send 'unsubscribe' to java-interest-request@java.sun.com
>
> hi,
> i'm having some problems trying to wrap my mind around how the
> JDK api handles events. i'm using the JDK and X11R6, if that helps.
>
> I want to be able to make a new TextField that allows me to configure
> what happens when keys are pushed. Preferably after I take the
> appropriate steps, i'd like to be able to pass a message back to the
> parent Applet of the TextField.
>
> however, when i try to override the boolean int keyDown(Event,int)
> method, the method never seems to get called.
>
> help/suggestions anyone?
>
> thanks,
> steve
>
>
> //---------- NewTextField.java ----------
>
> import java.awt.TextField;
> import java.awt.Event;
>
> public class NewTextField extends TextField {
> public MyTextField(String text, int cols) {
> super(text,cols);
> };
>
> public boolean keyDown(Event evt,int key) {
> System.out.println("keydown!: " + evt.toString() + " key: " + key);
>
> return true;
> };
>
> };
>
>
> //---------- NewTextFieldTest.java ----------
>
> import java.applet.Applet;
> import java.lang.System;
> import NewTextField;
>
> public class NewTextFieldTest extends Applet {
> MyTextField userTextInput;
>
> public NewTextFieldTest() {
> userTextInput = new MyTextField("hello!",80);
> add(userTextInput);
> }
>
> public void init() {
> resize(500,50);
> };
> }
>
>
> //---------- NewTextField.html ----------
>
> <title>argh!</title>
> <hr>
> <applet code=NewTextFieldTest.class width=500 height=50>
> </applet>
> <hr>
>
>
>
> -
> Note to Sun employees: this is an EXTERNAL mailing list!
> Info: send 'help' to java-interest-request@java.sun.com
>
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com