WK4 Programming Practice.
Working with Lists and Tabs
In this weeks practice program you are going to extend the Week 3 Pizza Graphical user Interface program and add JTabbs and JLists to the interface. While is it a good idea for you to continue working with the program you created in the previous week, you can download a working solution WK3_Practice_Pizza.zip and start with this solution.
If you have any questions or need any help post a question in the Programming/Practice Help discussion in the Introduction & Resources module.
- If you are using your solution, make a copy of your solution, rename it to WK4 Practice (or something similiar) then open up the copy.
- Create a new JFrame form in the application.
- Add a JTabb to new, blank form.
- Add two panels to the JTabb.
- Open up the “old” form with the original pizza controls, then select the controls and copy and paste them to the one of the panels in the new form with the JTabb
- You can copy all of them at once by holding down the CTRL key and clicking on the control.
- Selecting a panel will select all the elements in the panel.
- Notice that when you copy the controls all the events and handlers are copied over as well.
- Select all the code behind the original Pizza_Main (do not copy the control code) and paste it into the new JFrame.
- Run the program and ensure the collecting the pizza order information works as in the original program.
- In the second panel add
- JList that will hold the list of all the orders
- TextField that will display the selected order
- A delete order button that will delete a selected order.
- Update order button that will up the total cost of a selected order.