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.
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
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
System.out.println("File chooser cancel button clicked");
but for the user.dir what should i give mani? and in show dialog also hae some null for that?
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.
What happened when you run the application. Any exceptions?
Originally Posted by adarsh_2484
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.