How can I move out of a JTextArea/TextArea using the keyboard?
Created May 4, 2012
Sandip Chitale Compile and run this example. Use CTRL-TAB and CTRL-SHIFT-TAB to tab through the JTextArea.
import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TabOutTextArea { public static void main(String[] args) { JFrame f = new JFrame("TabOutTextArea Test"); f.getContentPane().add(new JTextField(), BorderLayout.NORTH); f.getContentPane().add(new JScrollPane(new JTextArea()), BorderLayout.CENTER); f.getContentPane().add(new JTextField(), BorderLayout.SOUTH); f.pack(); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); }}); f.setVisible(true); } }