-
KeyEvent question
hi there,
here is my problem i have an annonymous key listener registered on on
JTextfield named sqlArea, like so:
sqlArea.addKeyListener(new KeyAdapter(){
public void keyTyped(KeyEvent e)
{
if(e.getKeyCode()==e.VK_ENTER)
{
//processing...
}
}
});
the problem is that e.getKeyCode() always returns 0(zero) I can recoginize the enter key using if(e.getKeyChar=='\n') (which i had to do) but the whole thing seems really goofy and I just have to find out
why that happens.
Any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks