|
|
|
|
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.
|
|

07-25-2008, 09:13 AM
|
|
Member
|
|
Join Date: Jul 2008
Posts: 5
|
|
|
Please any one help me
I am new to Java.I have a text file in the server and I have to download it to the client.I have written the code.But it is not working.Please help me to correct it. Herewith I am attaching my code along with the message.Please go through it and rectify it.
With Regards,
Adarsh U
|
|

07-25-2008, 10:20 AM
|
|
Member
|
|
Join Date: Jul 2008
Posts: 2
|
|
|
Hai everyone....
How can we write the code for file selection in core java. The file dialog should contain text documents only.....Please reply as early as possible
|
|

07-25-2008, 10:50 AM
|
|
Member
|
|
Join Date: Jun 2008
Posts: 22
|
|
|
I think this may help u.....
-----------------
String wd = System.getProperty("user.dir");
JFileChooser fc = new JFileChooser(wd);
int rc = fc.showDialog(null, "Select Data File");
if (rc == JFileChooser.APPROVE_OPTION)
{
File file = fc.getSelectedFile();
filename = file.getAbsolutePath();
// call your function here
}
else
System.out.println("File chooser cancel button clicked");
return;
|
|

07-25-2008, 10:58 AM
|
|
Member
|
|
Join Date: Jul 2008
Posts: 2
|
|
|
but for the user.dir what should i give mani? and in show dialog also hae some null for that?
|
|

07-25-2008, 12:13 PM
|
 |
Senior Member
|
|
Join Date: May 2008
Posts: 299
|
|
Hello Priya,
I think u dont know anything about JFileChooser, check this link for more details it will give you what you are looking for also
Working with File Filters : JFileChooser*«*Swing*«*Java Tutorial
And one request please dont put your queries in other's post create a new thread for yourself and specify the queries as your queries may go unseen like this.
__________________
To finish sooner, take your own time....
Nivedithaaaa
|
|

07-25-2008, 12:37 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
Originally Posted by adarsh_2484
I am new to Java.I have a text file in the server and I have to download it to the client.I have written the code.But it is not working.Please help me to correct it. Herewith I am attaching my code along with the message.Please go through it and rectify it.
With Regards,
Adarsh U
What happened when you run the application. Any exceptions?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-25-2008, 05:51 PM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,223
|
|
Is this the same question as Can any one help me?
|
|

07-26-2008, 06:27 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
|
Yes, I guess so. Here need some feedback from our thread starter about this. Since to me both questions are same I have to merge those two together.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
All times are GMT +3. The time now is 02:08 AM.
|
|
VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org