demotextareaframe.java
来自「java绘图 java awt 经典绘图的例子,对于初学awt模块的人非常有帮助」· Java 代码 · 共 36 行
JAVA
36 行
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package swing;import javax.swing.JFrame;import javax.swing.JScrollPane;import javax.swing.JTextArea;/** * * @author zhaolin */public class DemoTextAreaFrame extends JFrame{ public DemoTextAreaFrame(){ JTextArea jta = new JTextArea(10,20); String content = "Hello\nWorld\n"; jta.setText(content); jta.setLineWrap(true); jta.setWrapStyleWord(true); JScrollPane jsp = new JScrollPane(); jsp.getViewport().add(jta); this.getContentPane().add(jsp); this.pack(); this.setVisible(true); } public static void main(String[] args) { new DemoTextAreaFrame(); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?