List of usage examples for javax.swing JTextArea grabFocus
public void grabFocus()
From source file:org.jactr.modules.pm.motor.MotorModuleTest.java
protected JFrame openWindow() { final JFrame frame = new JFrame("TextInput"); try {//from ww w .j a va 2 s .c om SwingUtilities.invokeAndWait(new Runnable() { public void run() { JTextArea textArea = new JTextArea(); frame.getContentPane().add(new JScrollPane(textArea)); frame.setSize(Toolkit.getDefaultToolkit().getScreenSize()); frame.setVisible(true); textArea.grabFocus(); } }); } catch (Exception e) { } return frame; }