• Post Reply Bookmark Topic Watch Topic
  • New Topic

copy + rename file using JfileChooser

 
shaon husain
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
ive seen so many examples of moving a file to a different destination, but they just seem so long about 100 lines of code for it, just wanna noe if theres a simpler version.
i have 2 buttons, 1 is to select(the browse button) and other(move button) is to move it and rename it,

this is what i have so far


i would like to set the final destination to the source of the project, and have the rename value already set, so user cannot change the name.
 
Campbell Ritchie
Marshal
Posts: 52548
119
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You use the file chooser to find the files; there are opreations in the File class, and in NIO2 classes like Path for changing files. There are sections about all that in the Java Tutorials.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!