There are two spots under were I have two put try catch statements with exception errors in I am not sure were or how to put them to accomplish whats listed below and help would be greatly appreciated. I had it working i started inserting another try catch statement under the add butoon it not working either. The exception error part is what i am missing from below I have tried with try catch statments requirments Part number (a TextField). For entering the part number. This value will be used as the key for storing and retrieving a specific Part object from the Map collection. The only edit that must be directly performed by the application is to verify that the part number does not exceed that of the HTML "maxPart" parameter (see below). Other editing (testing for a value less than zero) should be performed by methods of the Part class which may throw an Exception object. Description (a TextField). For entering and displaying the part description. It must never be null or blank when attempting to add a Part object to the Map collection. The editing should be performed by methods of the Part class which may throw an Exception object. Quantity (a TextField). For entering and displaying the part quantity. It must never be null, blank, or less than zero when attempting to add a Part object to the Map collection. The editing should be performed by methods of the Part class which may throw an Exception object. Add (a Button). When clicked, test the part number to determine if it is less than the maximum part number specified by the HTML "maxPart" parameter value (see processing notes below). If so, attempt to construct a Part object from the values in the text fields. If a construction error occurs, display an error message in the message area. If construction succeeds and if the part number is NOT already in the key set, add the Part object to the Map. Display the result in the message area ("Add successful", "Duplicate object", etc.).
Well one are that you should be checking for exceptions is in your part class when you set the values...
that is one place where errors may occur as you are attempting to set the partNumber, description, and quantity. if for any reason the information passed is wrong, ie null, or negative. It could blow up the program
Joined: Feb 11, 2003
I have tried it few differnt ways and nothing compiles this way,
Joined: Oct 02, 2002
What kind of compile errors are you getting? Are they something like this?
[ November 05, 2003: Message edited by: chris czinder ]