I am trying a simple socket based file transfer program to include a ProgressMonitorInputStream, my file transfer is working fine. But the progressMonitor never shows up.
I am sending a file from server to client, when it connects, my file is getting transfered perfectly, but just don t understand why the ProgressMonitor doesn t come up.
我搜索了一些例子,他们不是在管理信息系统中使用新的Jframe(),但是由于我在主机(主机)内,我没有这样做。
//client
InputStream is = sock.getInputStream();
BufferedInputStream bis = new BufferedInputStream(
new ProgressMonitorInputStream(new JFrame(),"reading",is));
while ((read = bis.read(buffer,0,buffer.length)) != -1) {
//read from socket...now write to file
}