Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating directory using JFileChooser

rachita mahendru
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear friend here is the code i had written but its not working
JFileChooser obj_FileChooser = new JFileChooser(".");
obj_FileChooser.setDialogTitle("Project files");
iReturnVal = obj_FileChooser.showDialog(frame, "Save Project");
if(iReturnVal == obj_FileChooser.APPROVE_OPTION)
System.out.println("inside approve option");
str = obj_FileChooser.getSelectedFile().getPath();
f1 = obj_FileChooser.getSelectedFile();
int dot = str.indexOf(".");
if ( dot > 0 )
JOptionPane.showMessageDialog(frame,"You should specify the project name","Warning Message",JOptionPane.WARNING_MESSAGE);
lv.projectname = str;
the code is not entering in the loop if i write a new string in the "filename" textfield of the JFileChooser. and hence i am unable to create a new directory with that name.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic