Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-10-2008, 05:49 PM
Member
 
Join Date: Jan 2008
Posts: 14
Joe2003 is on a distinguished road
Filechooser
Hey

Is it possible to open a filechooser that points at a paticular dirrectory?

Say i have the dir:-

/home/joe/Desktop/files

I want the filechooser to show everything in this dir. Is it possible

thanks alot

Joe
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-10-2008, 06:02 PM
sanjeevtarar's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Delhi(India)
Posts: 251
sanjeevtarar is on a distinguished road
Hello,

Ya it is possible....where do you want it.
In jsp or in applet...or else


sanjeev
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 06:15 PM
Member
 
Join Date: Jan 2008
Posts: 14
Joe2003 is on a distinguished road
Its just a standard java program, so neither :s

code is something like this:-

Code:
public static void main (String [] args) { JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(this); System.out.println(returnVal); System.out.println(fc.getSelectedFile()); }
but I just wanna open the filechooser to point at a given dir
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-16-2008, 06:56 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 527
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
There is another JFileChooser constructor that needs a parameter, and that parameter is a file, should be a directory....

If the received value from the parameter is a file, then the directory where that file is located will be used as a starting directory of JFileChooser....

kind regards,
sukatoa
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +3. The time now is 05:46 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org