想在客户闻端得弹出文件传输的进度,像这样的语句
(sock = new Socket(Connect.ipfile, 18091);
//     InputStream in =sock.getInputStream();
     InputStream in= new BufferedInputStream(
             new ProgressMonitorInputStream(
                     jpanel, 
                     "Reading " + "接收文件",
                     sock.getInputStream()));)——,那里有问题,为什么就弹不出来呢,
我猜想ProgressMonitorInputStream(Component parentComponent, Object message, InputStream in) 它的构造方法,的第三个参数上是不是有问题呢,我在服务器端的代码

 InputStream bis= new BufferedInputStream(
                new ProgressMonitorInputStream(
                        jpanel, 
                        "Reading " + file,
                        new FileInputStream(file)));
很正常,能够弹出文件传输的进度情况!

///////////////////////
请帮帮帮忙!!!!

解决方案 »

  1.   

    看一下java api
    ProgressMonitorInputStream
    public ProgressMonitorInputStream(Component parentComponent,
                                      Object message,
                                      InputStream in)
    Constructs an object to monitor the progress of an input stream. Parameters:
    message - Descriptive text to be placed in the dialog box if one is popped up.
    parentComponent - The component triggering the operation being monitored.
    in - The input stream to be monitored.
      

  2.   

    Constructs an object to monitor the progress of an input stream
    反对监控前进当中的输入流,
    但我的文件到客户端总要给客户一个进度条吧,像qq不是也有实现的吗?,
    用java怎么实现