文本域组件
public class JTextAreaTest extends JFrame{ public JTextAreaTest() { // TODO Auto-generated constructor stub setSize(200,100); setTitle("定义自动换行的文本域"); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); Container c = getContentPane(); JTextArea jt = new JTextArea("文本域",6,6); jt.setLineWrap(true); c.add(jt); setVisible(true); } public static void main(String[] args) { // TODO Auto-generated method stub new JTextAreaTest(); } }