拜托了 偶的swing很菜 什么都用jbuilder生成。。 帮忙罗 想把界面弄象个样子的

解决方案 »

  1.   

    把那个progress bar做成一个线程
      

  2.   

    你的意思是 把progress bar 弄到另外一个 frame上 做个镶嵌的线程类运行这个类?
      

  3.   

    long size = 100;//文件大小;
            File fileDest = null;//目标文件;
            FileOutputStream out = new FileOutputStream(fileDest);
            InputStream input = null;//你的InputString;
            byte[] bt = new byte[65536];
            int total;
            long done = 0;
            while ( (total = input.read(bt)) != -1) {
              out.write(bt, 0, total);
              done += total;
              //在这里设置你的进度条: 进度条.setValue(done/size);
              Thread.currentThread().sleep(50);
            }        input.close();
            out.close();