wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Browse/Upload Button 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 "Browse/Upload Button" Watch "Browse/Upload Button" New topic
Author

Browse/Upload Button

Jim Cutler
Greenhorn

Joined: Oct 13, 2010
Posts: 2
How do you create a "Browse/Upload" Button in Java? I want to be able to click on the "Browse" button, upload a folder of files, and have that pathname stored into a textfield.

What do I put under my actionPerformed() method?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3366
    
    9
Check out JFileChooser.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

Bill ForJoe wrote:


Please check your private messages for an important administrative matter.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jim Cutler
Greenhorn

Joined: Oct 13, 2010
Posts: 2
How do I upload a folder of files? FileChooser only allows me to upload one individual file.
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Jim Cutler wrote:How do I upload a folder of files? FileChooser only allows me to upload one individual file.


You can use it to get a File or an array of File. Please look at the API for File and you'll see that it can represent a single File or directories. In fact the very first line in the API states that File is:
An abstract representation of file and directory pathnames.


So it should work fine for you if you let it.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3366
    
    9
I'm a doctor, Jim...

Did you read the documentation?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Browse/Upload Button
 
Similar Threads
Multiple File Upload from a directory
how to delete multiple browse
file upload in sturts
Browse Button in HTML For Directory Selection
how to upload an image through jsp