| | |
Keylisteners and + - * /
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2005
Posts: 46
Reputation:
Solved Threads: 0
Im currently using method
getKeyText() and getKeyCode() like this
How do you listen for * - and + with keylisteners.
/ is the only one that works atm the rest won't get recognized for some reason
if(event.getKeyText(event.getKeyCode())).equals("/")){
//do something
}
that method works, but when I try using a + a - or a * nothing happens, maybe whenever I type * - + it isnt getting recognized or something? , like when I try * it places a number in the text field im using instead of showing a multi sign
getKeyText() and getKeyCode() like this
How do you listen for * - and + with keylisteners.
/ is the only one that works atm the rest won't get recognized for some reason
if(event.getKeyText(event.getKeyCode())).equals("/")){
//do something
}
that method works, but when I try using a + a - or a * nothing happens, maybe whenever I type * - + it isnt getting recognized or something? , like when I try * it places a number in the text field im using instead of showing a multi sign
![]() |
Similar Threads
- [ask] Need help about KeyListener in jTextArea (Java)
- Problem with Textfiled handling (Java)
- How do I deal with multiple button presses with KeyListener? (Java)
- Help me please...... (Java)
- JEditorPane Display Errors (Java)
Other Threads in the Java Forum
- Previous Thread: Looking for peer to peer programming resources
- Next Thread: applet , Runnable interface and problems
Views: 1538 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Java
911 addressbook android api append apple applet application arguments array arrays automation binary bluetooth character chat class classes client code component csv database draw eclipse error event exception file fractal ftp game givemetehcodez graphics gui helpwithhomework html ide image input integer j2me japplet java javaarraylist javaprojects jmf jni jpanel julia linked linux list loop map method methods mobile netbeans newbie number object objects oracle oriented panel print printf problem program programming project projects recursion replaydirector reporting researchinmotion return robot rotatetext scanner screen se server set size sms socket sort sql stream string swing test threads time transfer tree ubuntu windows





