Additional Notes


ItemListener

For the ItemStateChange, if you open your JavaDocs, go to the java.awt.event package, and then go to the ItemListener interface, you will see in the method summary section the following:
 
void itemStateChanged(ItemEvent e)
          Invoked when an item has been selected or deselected.
 
What this tells me is that if my class implements ItemListener, then I have to include a method with this signature:
public void itemStateChanged(ItemEvent e) {
}
If I have a Choice named itemNames, then I need to add it as an ItemListener:
itemNames.addItemListener(this);
Now, when a user selects an Item in the Choice, the itemStateChanged event is fired.
 
A Choice has a method called getSelectedIndex(). Use the index value to pull the related ID from an array.
 
A lot of knowing Java is knowing how to navigate the JavaDocs. I use them constantly.

Application Flow

The flow is like this:
  1. Frontend starts
  2. Frontend requests connection
  3. Listener accepts connection
  4. Listener passes connection to FileReader
  5. Frontend sends LO to FileReader
  6. FileReader sends comma-separated list to Frontend
  7. Frontend parses list and populates Choice
  8. User selects from Choice
  9. Front
  10. Frontend requests connection
  11. Listener accepts connection
  12. Listener passes connection to FileReader
  13. Frontend sends R# to FileReader
  14. FileReader sends comma-separated list to Frontend
  15. Frontend parses list and populates TextFields
 
Your file is line after line in the following format:  ID,Name,Property1,Property2,Property3.  You need to manually create this text file using a text editor.
 
The comma-separated list for Step 6 is in the format ID,Name,ID,Name........etc. It needs to read every line in the file and generate this string.
 
The comma-separated list for Step 14 is on of the lines from the file in the format ID,Name,Property1,Property2,Property3 where the ID matches the # sent in Step 13.