I have two combo boxes containing names of teams read from a file, the idea is that one is the home team, the other the away team. The two combos are reading from the same file, however, how could I remove the team from the other combo if it was selected in the first one? I hope my question makes some sense. I just need some guidance on how to tackle this.
BufferedReader input = null;
try
{
input = new BufferedReader(new FileReader("CSLteams.dat"));
}
catch (FileNotFoundException e1)
{
e1.printStackTrace();
}
ArrayList<String> strings = new ArrayList<String>();
try
{
String line = null;
while (( line = input.readLine()) != null)
{
strings.add(line);
}
}
catch (FileNotFoundException e)
{
System.err.println("Error, file " + "CSLteams.dat" + " didn't exist.");
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
try
{
input.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
String[] teamArray = strings.toArray(new String[]{});
So the teamArray is the list that appears in my combo boxes.