📄 testdiao.java
字号:
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.TextArea;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
public class TestDiao extends Frame {
static TextArea ta = new TextArea();
public static void main(String[] args) {
new TestDiao().launchFrame();
ta.setBounds(150,150,100,100);
HashSet set=new HashSet();
try {
BufferedReader in = new BufferedReader(new FileReader("d://werwew.txt"));
String str;
while ((str = in.readLine()) != null) {
ta.setText(str);
System.out.println(str);
}
in.close();
} catch (IOException e) {
System.out.println("文件读取错误!");
}
}
public void launchFrame() {
setLocation(100,100);
setSize(300,300);
this.setResizable(false);
add(ta, BorderLayout.CENTER);
setVisible(true);
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
super.windowClosing(e);
}});
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -