aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes file upload in swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "file upload in swing" Watch "file upload in swing" New topic
Author

file upload in swing

vidya archana
Ranch Hand

Joined: Oct 29, 2002
Posts: 36
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

Joined: Sep 28, 2000
Posts: 508
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: file upload in swing
 
Similar Threads
help needed
Struts 2 FileUpload Interceptor Problem for Large File Size Upload....
can I use JFC Swing?
Upload a file to unix and invoke a java method
Browse/Upload Button