📄 try.java
字号:
import java.io.*;import java.awt.*;import java.awt.event.*;
class Try
{ public static void main(String args[])
{ int b;
TextArea text;
Frame window=new Frame();
//byte tom[]=new byte[25];
window.setSize(100,100);text=new TextArea(10,16);
window.setVisible(true);window.add(text,BorderLayout.CENTER);
window.pack();
window.addWindowListener(new WindowAdapter()
{ public void windowClosing(WindowEvent e)
{ System.exit(0);
}
});
try{ File f=new File("Example20_3.java");
FileInputStream readfile=new FileInputStream(f);
while((b=readfile.read())!=-1)
{
String s=new String (String.valueOf(b));
System.out.println(s);
text.append(s);
}
readfile.close();
}
catch(IOException e)
{ System.out.println("File read Error");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -