title: How do you set a focus on JTextField in Swing?
body: <p>I created a form using Swing in Java. In the form I have used a <code>JTextField</code> on which I have to set the focus whenever I press a key. How do I set focus on a particular component in Swing?</p>