📄 scanlog.java
字号:
package studentsystem;import javax.swing.*;import java.awt.*;import java.io.*;import java.awt.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2006</p> * <p>Company: </p> * @download by http://www.codefans.net * @author not attributable * @version 1.0 */public class scanLog extends JFrame { JScrollPane jScrollPane1 = new JScrollPane(); JTextPane xs = new JTextPane(); String str; int b; byte buffer[]=new byte[2500]; public scanLog() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } try {FileInputStream readfile=new FileInputStream("log.txt"); b=readfile.read(buffer,0,2500); try { str=new String(buffer,0,b,"default"); xs.setText(str); } catch(UnsupportedEncodingException e) { //System.out.println("the encoding was not found :"+e); } } catch(IOException e) {System.out.println("File read Error"); } } private void jbInit() throws Exception { this.setResizable(false); this.setTitle("查看日志"); this.getContentPane().setLayout(null); jScrollPane1.setBounds(new Rectangle(18, 32, 449, 333)); this.getContentPane().add(jScrollPane1, null); this.setBounds(200,200,600,400); this.setVisible(true); }public static void main(String[] args) { scanLog scanLog = new scanLog(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -