Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

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>&nbsp;&nbsp; I want to add a key =
listener to a=20
JInternalFrame.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; I try this:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
JInternalFrame=20
frame =3D new JInternalFrame(.....);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
....</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frame.addKeyListener(n=
ew=20
KeyAdapter() {<BR>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public=20
void keyPressed(KeyEvent e) {&nbsp; </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ...</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; but doesn't work.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;=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