How would I go about searching a map that hasbeen written to a file?
My GUI has a method caled processFind() which prints all keys in the map, I have this working but not if the map is saved to a file.
private void processFind()
{
gui.results.setText("");
for (Object s : customerDetails.keySet())
{
gui.results.append(s.toString().toUpperCase() + ": " +
customerDetails.get(s).toString().toUpperCase()
+ newline);
}
}
I also have a method that prints all key/value pairs that begin with a user defined string
private void processSearchUser()
{
gui.results.setText("");
String upper = gui.nameText.getText().toUpperCase();
for(Object s : customerDetails.keySet())
{
if(s.toString().startsWith(upper))
{
gui.results.append(s.toString().toUpperCase() + ": " +
customerDetails.get(s).toString().toUpperCase()
+ newline);
}
}
if (gui.nameText.getText().equals(""))
{
JOptionPane.showMessageDialog(null, "Please enter part of a name to search");
}
}
Thank for looking
Glen..