word2.java

来自「这是排序与表的利用和小型word模拟的java的程序」· Java 代码 · 共 48 行

JAVA
48
字号
package yu2;

import java.beans.PropertyVetoException;

import javax.swing.JInternalFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class word2 extends JInternalFrame {
	  private JTextArea ta1;
	  private static int i=0;
	  word2(){
		  super("文档"+(i+1),true,true,true,true);
		  this.setSize(300,400);
		  ta1=new JTextArea();
		  this.getContentPane().add(new JScrollPane(ta1));
		  this.setLocation(20*i,15*i);
		  i++;
		  this.setVisible(true);
	  }
	  public void copy(){
		  this.ta1.copy();
		
	  }
	  
	  public void cut(){
		  this.ta1.cut();
		
	  }
	  public void paste(){
		  this.ta1.paste();
		
	  }
     public void huanhang(){
    	  this.ta1.setLineWrap(true); 
     }
     public void nothuanhang(){
    	this.ta1.setLineWrap(false); 
     }
     public void close(){
    	try {
			this.setClosed(true);
		} catch (PropertyVetoException e) {
			e.printStackTrace();
		}
     }
	}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?