Helo! I need a simple java code that ask the user to select a jar file by navigating through hard drive and then i want that selected file to store /write in a particular destination(ie my own folder)..Thanks
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Helo! I need a simple java code that ask the user to select a jar file by navigating through hard drive and then i want that selected file to store /write in a particular destination(ie my own folder)..Thanks
The JFileChooser class is useful for allowing a user to choose a file to open.
For reading from and writing to a file, the RandomAccessFile is useful.
If you don't understand my answer, don't ignore it, ask a question.
ok ...JFilechooser will help me to just point to a file then is there a way to just copy that file to particular destination without reading or writing...ie i need a simplest way of copying that file to some other destination,,,
The easiest way is to simply copy the contents yourself.
Create a new File object at the target destination, open the new file object, write the contents of the old file into the new file, and then remove the old file.
That sounds like magic: no reading or writing.copy that file to particular destination without reading or writing.
To copy a file, the source must be read and the new file written.
If you don't understand my answer, don't ignore it, ask a question.
Thanx! alot brother
Some OSs have utilities to copy files. Perhaps you could execute one of them to do the copy.
If you don't understand my answer, don't ignore it, ask a question.