I want to write a key listener to listen for only numeric keys. How can I achieve this?
Here's what I've tried:
if (  e.getKeyCode() > 96 & e.getKeyCode() < 106
   || e.getKeyCode() > 47 & e.getKeyCode() < 58)
{
    // do something
}
What is the problem in this code?
 
     
     
    