📄 fileapp2.java
字号:
package stream;import javax.swing.UIManager;import java.io.*;/** * Title: * Description: * Copyright: Copyright (c) 2002 * Company: * @author * @version 1.0 */public class FileApp2 { boolean packFrame = false; /**Construct the application*/ public FileApp2() { Frame1 frame = new Frame1(); //Validate frames that have preset sizes //Pack frames that have useful preferred size info, e.g. from their layout if (packFrame) { frame.pack(); } else { frame.validate(); } frame.setVisible(true); } /**Main method*/ public static void main(String[] args) { byte buffer[]=new byte[80]; try {System.out.println("\nEnter a line to be saved to disk:"); int bytes =System.in.read(buffer); FileOutputStream fileOut=new FileOutputStream("line.txt"); fileOut.write(buffer,0,bytes); } catch(Exception e) {String err=e.toString(); System.out.println(err); } try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { e.printStackTrace(); } new FileApp2(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -