• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

file upload in swing

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic