Ok thanks a lot. Just one last problem. When i removed the string builder, now it is issuing a missing return statement. What is missing? And it is always displying the questions 2 times. First it displays the questions, and then for a second time it display them again. Thanks a lot. And i really have to thank you for your help. Thanks again. :-)
In this code:
private String[] readFile3(String path) {
StringBuilder sb = new StringBuilder();
String separator = "\n";
DataInputStream in = null;
try {
in = new DataInputStream(new
BufferedInputStream(new FileInputStream(dataFile3)));
String desc;
try {
while (true) {
desc = in.readUTF();
JOptionPane.showInputDialog(null, desc);
sb.append(desc + separator);
}
} catch (EOFException e) { }
}
catch(IOException e)
{
System.out.println( e.getMessage() );
System.exit(1);
}
// here i think is a missing return statement
}