CIS-355A Java Course Project
Java, java, java. What a fun and versatile language. I've spent the past 7 weeks learning it in my Java Application course taught by Professor Rick Bird. While I'm admittedly no expert, I do believe I have the basics down.
The project began with as a written problem analysis complete with a mock up illustration of the application. This is figure shows the design plan for the last tab, the Order Summary tab. To accomplish this portion of the project, I used Microsoft Visio.
At first, I had a flooring class as well as a customer class. But because I did not have a database table with a primary key column, it was much easier to add all the information in the flooring class. This helped me create my ArrayLists as well. I originally had two: one a customer list and one a flooring list. This was very hard when looping through two lists to add the values from two separate classes into one database table. In real life, this would have been unacceptable to pile all the data into one class and to not have a normalized database table.
I created a GUI application using NetBeans GUI builder which I have found to be fairly intuitive and convenient to use. I started with a JFrame and added a JTabbedPane element. Then I added three JPanels which became my three tabs. My first tab gathers information for the order. I used radio buttons for the flooring selections and added a TextToolTip to show the price per sq.ft. of each flooring option. The room size must be determined by input from the Length and Width textboxes. These both had validation messages to ensure these fields are not null and are numeric.
The user must then click the calculate buttons to reveal their area and cost. Both of those text fields are set to un-editable. The second tab was for the purpose of obtaining the customer's information. I did not originally plan to have a submit button here but I felt the need to have an action method here to add all the flooring objects into an ArrayList. I actually add the record to the database at this point as well. I felt this was better for retrieving data to display on the next tab.
As you can see the third tab contains the lists. I found the lists to be the most difficult portion of the coding. I used a select * statement to get the data from the database and display it on the View summary list. Unfortunately, I only needed to show the current record, not all of the records. I could not figure out how to do this without having a reference to a primary key value in the database table. You can't do a select and order by clause without one. View order list caused me the same strife. I planned on using this as the Order history but I'm not sure that I executed that goal very fluently. However, the user will click Submit order to place their order for processing. Submit order also clears the lists for the next order instance.
Overall this was a fun and challenging process. I wish I could have sorted out my lists better but I feel that poor database design led to the demise of this program.
Stay tuned for more from my upcoming projects. I will be a Senior in May 2018 so I will have plenty of material to add to this blog. I'll keep coding and you keep reading!
For our course project, we were required to create an Order Application for a Flooring Company. The user requirements summarized are:
1. Must have 3 tabs.
2. Must select flooring type: wood or carpet
3. User must enter length and width of their room.
4. Must calculate cost and the room area.
5. Must obtain customer information.
6. Must create two lists: Order Summary and Order List
7. Must connect to a table in a database.
As I'm sure you can ascertain this project was not easy and involved a lot of Java elements such as ArrayLists, JTabbedPanes, Radio Buttons, Text Fields/Areas, and Jar file connection to the database.
The next phase was coding the application, creating a user manual and a course presentation. I admit that the coding portion was the most challenging for me. As coding is an iterative process, I changed the design several times before finding the best way to code the project.
At first, I had a flooring class as well as a customer class. But because I did not have a database table with a primary key column, it was much easier to add all the information in the flooring class. This helped me create my ArrayLists as well. I originally had two: one a customer list and one a flooring list. This was very hard when looping through two lists to add the values from two separate classes into one database table. In real life, this would have been unacceptable to pile all the data into one class and to not have a normalized database table.
I created a GUI application using NetBeans GUI builder which I have found to be fairly intuitive and convenient to use. I started with a JFrame and added a JTabbedPane element. Then I added three JPanels which became my three tabs. My first tab gathers information for the order. I used radio buttons for the flooring selections and added a TextToolTip to show the price per sq.ft. of each flooring option. The room size must be determined by input from the Length and Width textboxes. These both had validation messages to ensure these fields are not null and are numeric.
The user must then click the calculate buttons to reveal their area and cost. Both of those text fields are set to un-editable. The second tab was for the purpose of obtaining the customer's information. I did not originally plan to have a submit button here but I felt the need to have an action method here to add all the flooring objects into an ArrayList. I actually add the record to the database at this point as well. I felt this was better for retrieving data to display on the next tab.
Overall this was a fun and challenging process. I wish I could have sorted out my lists better but I feel that poor database design led to the demise of this program.
Stay tuned for more from my upcoming projects. I will be a Senior in May 2018 so I will have plenty of material to add to this blog. I'll keep coding and you keep reading!
Comments
Post a Comment