Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 03-01-2004, 02:14 PM   #1 (permalink)
 
Super Techie

Join Date: Feb 2004

Posts: 261

dbernie41

Default Java help

What is the Java programming code to cause an error on the press of a certain key? For example... If the program would be open and a person would press "Enter", I want a window to pop up or make it beep. I know how to make it beep but I dont know if there is like an

onKeyPress() method or something.

I hope I made this clear enough
dbernie41 is offline  
Old 03-05-2004, 11:31 PM   #2 (permalink)
 
Junior Techie

Join Date: Oct 2003

Posts: 85

zoerb

Default

is it in an applet, or application? in an applet, you can just override the public boolean keyDown(Event e) method. you might have to implement a KeyListener for an application.
__________________
Asus A7n8x-x
athlon 2800
radeon 9600 pro
512 mb 2700 mem
western digital 80gb special edition
zoerb is offline  
Old 03-13-2004, 05:14 AM   #3 (permalink)
 
Ultra Techie

Join Date: Feb 2004

Posts: 833

hygor

Default

you can kinda cheat and write this into an if statement or use one of the error libraries... i did this a while ago the supposed proper way... will look back through me code and try to find it!
__________________
hygor is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On