English 中文(简体)
Progress MonitorInputStream不工作?
原标题:ProgressMonitorInputStream not working?
  • 时间:2012-01-15 10:07:04
  •  标签:
  • java
  • swing

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 
}    
最佳回答
I searched some examples, they used  this  instead of  new Jframe()  in PMIS

You have re_read tutorial about How to Use Progress Bars, there is basic description for ProgressMonitorInputStream

rel=“nofollow”>single threaded,如果你希望使用progress,则须将转至BackroundTask , tutorial about Jress=Bar

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签