Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How can I add a KeyListener to a JInternalFrame?
- From: cosmin@xxxxxxxxxx (Cosmin Neag)
- Subject: How can I add a KeyListener to a JInternalFrame?
- Date: Thu, 30 Nov 2000 18:18:21 +0200
This is a multi-part message in MIME format.
------=_NextPart_000_00CF_01C05AF9.EBB1D2B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I want to add a key listener to a JInternalFrame.
I try this:
JInternalFrame frame =3D new JInternalFrame(.....);
....
frame.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) { =20
...
}
}
=20
but doesn't work.
Thanks.
------=_NextPart_000_00CF_01C05AF9.EBB1D2B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2> I want to add a key =
listener to a=20
JInternalFrame.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> I try this:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =
JInternalFrame=20
frame =3D new JInternalFrame(.....);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
....</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2> frame.addKeyListener(n=
ew=20
KeyAdapter() {<BR> =
public=20
void keyPressed(KeyEvent e) { </FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
...</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2> &nbs=
p;}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> </FONT></DIV>
<DIV><FONT face=3DArial size=3D2> but doesn't work.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =20
Thanks.</FONT></DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_00CF_01C05AF9.EBB1D2B0--
---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx
- Prev by Date: random numbers
- Next by Date: display chinese in JLabel
- Previous by thread: Killing another process
- Next by thread: display chinese in JLabel
- Index(es):