File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

file upload in swing

 
vidya archana
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to an upload programming in one button of my swing interface.Can any one tell me where I can find examples of upload in swing .
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know of any examples on the net, but I can tell you what you need:
1. a JFileChooser, so the user can specify what file to upload (if that is not clear, yet).
2. you should read about multithreading - now that you know which file where to put, you should open a background thread so that the ui does not freeze. (in fact you will need two threads: a workerthread and a controlling thread (which can open a progress monitor (see JProgressBar etc.), for example). There is a class SwingWorker provided by sun (not in the JDK! - Swing Tutorial), it might help you. I don't use it, I found my own way through the threading stuff.
3. if you are not familiar with io in java, you should read about that, as well. (the java tutorial is a good start.)
4. I suppose "upload" means to transfer the file over the network to the server - thus you will need compression (java.util.zip) and networking (java.net). (same here: Java Tutorial)
hope this was of any help
Chantal
[ November 29, 2002: Message edited by: Chantal Ackermann ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic