📄 introduceframe.java
字号:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
public class IntroduceFrame extends JFrame
{
TextArea introduceArea;
byte buffer[];
int bufferLength;
public IntroduceFrame()
{
buffer = new byte[100000];
try
{
File file = new File("help","introduce.txt");
if(!file.exists())
{
System.err.println("Introduce text is not existing");
}
FileInputStream fileInputStream = new FileInputStream(file);
bufferLength=fileInputStream.read(buffer);
fileInputStream.close();
}
catch(Exception e)
{
}
String string = new String(buffer);
introduceArea = new TextArea(string);
introduceArea.setBackground(Color.LIGHT_GRAY);
introduceArea.setEditable(false);
setTitle("Introduce Text");
setSize(500,450);
getContentPane().add(introduceArea);
// pack();
addWindowListener
(
new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
setVisible(false);
}
}
);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -