Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to delete the file/folder in java using jfile chooser  RSS feed

 
prajna pa
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using jfilechooser if i am selecting selecting a folder it should delete the folder and the entire contents under that folder.
at the same time by selecting the file it should delete only that file my code is working only for file deletion not for folder.


pl z help me thanks in advance.
 
Swastik Dey
Rancher
Posts: 1812
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be this helps

http://www.mkyong.com/java/how-to-delete-directory-in-java/
 
prajna pa
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
swastik
thank you so much swastik it is working now
 
Swastik Dey
Rancher
Posts: 1812
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome.
 
prajna pa
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
swastik...
i had posted a problem in viewing the files in thumbnail form in jfilechooser..
can you suggest any solution for that..
thanks in advance
 
Swastik Dey
Rancher
Posts: 1812
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess a solution has been already given there.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!