You must add a KeyListener to the Canvas3D. Adding the following code to the
program I sent previously will exit the application when you press ESC:
canvas.addKeyListener(new KeyAdapter()
{
public void keyPressed(KeyEvent event)
{
if (event.getKeyCode() == KeyEvent.VK_ESCAPE) System.exit(0);
}
}
);
Guang Bin Liu wrote:
> Hi Renoir:
>
> I am grateful to your kind help. One more question: When I use JFrame, I
> can use KeyEvent to quit my application. But this does not apply to the
> JWindow. Could you (or any one else) please let me know under JWindow, how
> I can perform KeyEvent? Thank you a lot!
>
> Guang Bin Liu
> VTHRC
> Univ. of Queensland
> St Lucia 4072
> Brisbane, Australia
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
--
Renoir Sewjee
Software Engineer
ISS International (Welkom)
Tel: +27 (0)57 912 2702
Fax: +27 (0)57 912 2652
--
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".