Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7075657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:12:13+00:00 2026-05-28T06:12:13+00:00

I am trying a simple socket based file transfer program to include a ProgressMonitorInputStream,

  • 0

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.

I searched some examples, they used ‘this’ instead of ‘new Jframe()’ in PMIS, but since I was inside main(), it didn’t allow me to do that.

//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 
}    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:12:13+00:00Added an answer on May 28, 2026 at 6:12 am
    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

    Swing is single threaded and if you want to move with progress, then you have to redirect this Stream to the BackroundTask, tutorial about JProgressBar implelemnts SwingWorker, another options is wrap that to the Runnable#Thread, but in this case output to the GUI must be wrapped into invokeLater()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a simple send and receive UDP program working, but I'm
I am trying to write a simple program to open a socket channel to
I'm trying to simulate a socket client using simple perl program. socket client: #!/usr/bin/perl
I am trying to write a sample Raw socket program to clear my understanding
I am trying something very simple, but for some reason it does not work.
I'm trying to create a simple WebSocket example using the HTML5/JS API. Based on
Based on a college-project I'm trying to realize a relatively simple game (Poker) where
So, I made a simple socket server using python. And now I'm trying to
I'm trying to get a simple example working with GCDAsyncSocket, and am discovering that
I am trying to make a simple client-server chat program. On the client side

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.