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

📄 example10_20.java

📁 不错的教程 适合中高级人员的使用
💻 JAVA
字号:
import javax.swing.*;
import java.io.*;import java.awt.*;import java.awt.event.*;
public class Example10_20
{ public static void main(String args[])
  { byte b[]=new byte[30];
    JTextArea text=new JTextArea(20,20);
    JFrame  jframe=new JFrame();
    jframe.setSize(200,300);jframe.setBackground(Color.blue);
    jframe.setVisible(true);
    jframe.addWindowListener(new WindowAdapter()
         {public void windowClosing(WindowEvent e)
            {System.exit(0);} });
    Container contentpane=jframe.getContentPane();
    contentpane.add(text,BorderLayout.CENTER);
   
 try{  FileInputStream input=new FileInputStream("Example10_20.java");
        ProgressMonitorInputStream input_progress=
           new ProgressMonitorInputStream(contentpane,"读取java文件",input);
       ProgressMonitor p=input_progress.getProgressMonitor();//获得进度条。
       while(input_progress.read(b)!=-1)
          { String s=new String(b);
            text.append(s);
            Thread.sleep(1000);//由于文件较小,为了看清进度条这里有意延缓1秒。
          }
     }
     catch(InterruptedException e){}
     catch(IOException e){}
  }
}

⌨️ 快捷键说明

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