⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 open.java

📁 模拟实现对windows的记事本多线程查找
💻 JAVA
字号:
import java.io.*;
import javax.swing.*;

public class Open extends Thread{
	public void run(){
		if(FileDialogDemo.jfc.showOpenDialog(new JFileChooser())
				== FileDialogDemo.jfc.APPROVE_OPTION)
		{
			open(FileDialogDemo.jfc.getSelectedFile());		
		}
			
	}
	public static void open(File file){
		try{
			BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
			byte[] b = new byte[in.available()];
			in.read(b,0,b.length);
			FileDialogDemo.jta.append(new String(b,0,b.length));
			in.close();
			FileDialogDemo.lab.setText(file.getName() + "Opened");
		}
		catch(IOException ex){
			FileDialogDemo.lab.setText("Error opening" + file.getName());
		}
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -