title: JTextfield Listener for Integers
body: <p>I am having troubles in finding a solution to write a listener for a <code>JTextField</code> specifically to only allow integer values (No <code>String</code>s allowed). I've tried <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/documentlistener.html" rel="nofollow">this recommended link</a> on Document Listener, but I don't know what method to invoke etc. </p>
  
  <p>I've never used this type of Listener before, so could anyone explain how I could write a listener on a <code>JTextField</code> to only allow integer values that can be accepted?</p>
  
  <p>Basically after I click a <code>JButton</code>, and before the data is extracted out onto a variable, then Listener will not allow it to be processed until an integer is inputted.</p>
  
  <p>Thanks very much appreciated.</p>