Tuesday, 11 February 2014

Invalid Entry

So the continue button now has a bit of a function - if it finds that one of the fields is empty, it displays a JOptionPane that looks like the following:



So that's successful! The clear button also works, by clearing all the fields. (actually before, I had accidentally set it to clear the west rather than the centre so POP and everything on the left disappeared.)

Also, given that these are the index numbers;

         if (i == 0) addWestFields[i] = new JTextField("Place of Stay");  
         if (i == 1) addWestFields[i] = new JTextField("Name of Accommodation: ");
         if (i == 2) addWestFields[i] = new JTextField("Date of Stay (mm, dd): ");
         if (i == 3) addWestFields[i] = new JTextField("Type of Accommodation: ");
         if (i == 4) addWestFields[i] = new JTextField("Price Per Person");
         if (i == 5) addWestFields[i] = new JTextField("Other Information");

Well, yeah. Self explanatory.

No comments:

Post a Comment