• Post Reply Bookmark Topic Watch Topic
  • New Topic

create Directory using JFileChooser

 
rachita mahendru
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear friend
i want to pop up a JFileChooser Dialog box that displays only the directories(this has been achieved). now i want that what ever user types in the textfield. the directory with that name should be created in the specified path. how can we achieve this. please reply as soon as possible.
thanx
rachita
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rachita,
How about the File methods:
mkdir and mkdirs
Regards,
Manfred.
 
rachita mahendru
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear friend
i have used the method setFileSelectionMode(DIRECTORIES_ONLY) to display the directories only. i have tried using the save dialog and the custom dialog such that what ever name user types in the textfield labeled "file name" in the JFileChooser Dialog box and clicks on the save button the code included in the APPROVE_OPTION should be executed but the program is not entering into that loop, i am using the mkdir() method in this loop only. i dont know where the bug lies please help me out.
thanx
reply as soon as possible
rachita
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you show some code?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!