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 272589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:20:01+00:00 2026-05-12T00:20:01+00:00

I need a simple application, preferably a cross-platform one, that enables sending of files

  • 0

I need a simple application, preferably a cross-platform one, that enables sending of files between two computers.

It just need to accept and send the files, and show a progress bar. What applications could I use or how could I write one?

  • 1 1 Answer
  • 2 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-12T00:20:01+00:00Added an answer on May 12, 2026 at 12:20 am

    Sending and Receiving Files

    The sending and receiving of a file basically breaks down to two simple pieces of code.

    Recieving code:

    ServerSocket serverSoc = new ServerSocket(LISTENING_PORT);
    
    Socket connection = serverSoc.accept();
    
    // code to read from connection.getInputStream();
    

    Sending code:

    File fileToSend;
    InputStream fileStream = new BufferedInputStream(fileToSend);
    
    Socket connection = new Socket(CONNECTION_ADDRESS, LISTENING_PORT);
    OutputStream out = connection.getOutputStream();
    
    // my method to move data from the file inputstream to the output stream of the socket
    copyStream(fileStream, out);
    

    The sending piece of code will be ran on the computer that is sending the code when they want to send a file.

    The receiving code needs to be put inside a loop, so that everytime someone wants to connect to the server, the server can handle the request and then go back to waiting on serverSoc.accept().

    To allow sending files between both computers, each computer will need to run the server (receiving code) to listen for incoming files, and they will both need to run the sending code when they want to send a file.

    Progress Bar

    The JProgressBar in Swing is easy enough to use. However, getting it to work properly and show current progress of the file transfer is slightly more difficult.

    To get a progress bar to show up on a form only involves dropping it onto a JFrame and perhaps setting setIndeterminate(false) so hat it shows that your program is working.

    To implement a progress bar correctly you will need to create your own implementation of a SwingWorker. The Java tutorials have a good example of this in theirlesson in concurrency.

    This is a fairly difficult issue on its’s own though. I would recommend asking this in it’s own question if you need more help with it.

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

Sidebar

Related Questions

I need to create a simple application that would generate reports based on database
I writing simple application that need to make some record of the incoming sound.
I need to create a simple application where the Servlet reads two inputted parameters,
I need to add one functionality to my simple application - to allow user
i need to write simple android application that run on the background and read
I need simple start an application from my code, like Skype, or other one.
I need to develop a simple application that allows the user to write some
I need to write simple application that can send and receive some UDP package
I have simple console application project for live video streaming using cross-platform libs on
I need to write simple application that will run on mac. The application need

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.