You have been employed to create program to assist the manager of a coffee shop. You decide
Fantastic news! We've located the answer you've been seeking!
(10 points) Display Coffees Interface Create JFrame that shows the information in the Coffee Table for the user. It should be presented in a grid or table. Keep the same look and feel of the main interface (same fonts and colors.)
Display Orders for Customer Interface Create JFrame that shows the information in the Orders Table for the one customer. You can create this in a grid or table with filter controls on the screen or have a combo box loaded with customer IDs to choose from (as may be shown in the lecture on databases) or use similar means to display the orders for one customer along with their name. [You can't hard code the customers in as menu choices or radio buttons. You could have the user enter in an ID, name, or other identifying information into text boxes and use them for a select. You could also get this information from a JOptionPane before showing this form if you like. The point of this one is that you will have to join tables and pass in a value for a where clause in the SQL statement.] Keep the same look and feel of the main interface (same fonts and colors.)
New Customer Interface Create screen to add a new customer. It should contain text boxes for all the fields in the customer table except the credit limit. Every new user has a starting Credit Limit of 200.00 so you don't need a control to get this from the user. Have a button to validate all the fields (see below) and then insert a new record into the customer table. (10 points) New Order Interface Create screen to add a new order. It should have controls to accept values from the user to create new record in the order table. Have a button to validate all the fields (see below) and then insert a new record into the order table.
Make sure to have a try/catch around the code to connect to and insert into the database. You should also use string functions or regex controls to make sure string values are not larger than the fields you created in your database before you do the insert (and if so you should give the user a JOptionPane message about it rather than doing the insert.) Also use a Regular Expression to check and make sure an e-mail address is in a valid e-mail address format.
[Note: For the e-mail address regular expression it is not in your book. I would find the pattern on the internet. It took me less than 10 seconds when I searched "regular expression format for email" and looked at the one under www.java2s.com . Real ones that check e-mail address patterns will be long because they account for everything. If you want to write own simpler pattern to check for the @ and dot with characters before and after I am fine with it.]
Related Book For