public String[] readNames(String filename)
{
String[] names = new String[5];
String currentLine = "", line = "";
int index = 0;
try
{
Scanner in = new Scanner(new File(filename));
while(in.hasNext())
{
line = in.nextLine();
if ( line.startsWith("name"))
{
names[index] = line.substring(7);
index++;
}
}
}
catch(IOException ex)
{
ex.printStackTrace();
}
return names;
}