I've got some code where I am trying to read a text file with BufferedReader so that I can read a list to pass a string to another piece of code. It will show me the first JOptionPane, but not the second.
import java.io.*;
import java.util.*;
import javax.swing.*;
public void ReadFolders()
{// Begin ReadFolders
String s=null;
try
{//Begin try block
//Read text file and place items in hash table
JOptionPane.showMessageDialog(null, "step 2");//GETS HERE
BufferedReader DB=new BufferedReader (new FileReader("C:\\folderName.txt"));
JOptionPane.showMessageDialog(null, "step 3");//DOES NOT GET HERE
while ((s=DB.readLine())!=null) //loop until out of lines in the text file
{
//put String tokens in hashtable
JOptionPane.showMessageDialog(null, "step 4");
CreateFolder(s);
JOptionPane.showMessageDialog(null, "step 5");
}//end while loop
DB.close();
}//end of try block
catch(IOException ioe){}
catch(NoSuchElementException ix){}
}//end of ReadFolders
Any help will be appreciated.
Thank you,
Brian
Edited by: BrianT on Dec 17, 2008 11:56 AM