Description
In this stage, you need to help the Merchant keep track of all incoming orders in an extended table.
So far, we are leaving the incoming orders as they are, and the Merchant has lost track of the inventory. During this stage, you need to build a second GUI screen that contains JTable with a detailed description of the orders. This view should also contain a filter button for each supplier.
Objectives
At this stage, your program should behave like this:
- The main window should contain a
JTabbedPane(namedTabbedPane) that allows switching between two views. The first tab which is used to select the type of wine should be titledInput Supplier Orderand the new tab should be titledSupplier Orders List. - Set a new
JPanelfor Supplier Orders List tab and add three Swing components:
- A
JComboBox- a dropdown box that contains all the supplier names. Name this element asSupplierOrderComboBox; - A
JButton- a button that enables filtering per supplier. Name it asFilterButtonand set its text toFilter. The top element of the dropdown menu should beAll Orderswhich should allow users to go back and view all orders. You can use RowFilter for this. - A
JTablecalledOrdersTablethat displays all orders. Change it every time a new order is added or when a filter is utilized. The table should contain 5 columns:Supplier,Wine,Amount Purchased,Purchased Price, andPaid. The default boolean value forPaidisFalse. Look into DefaultTableModel to learn how to populate the table with your data.
Examples
Example 1: wine & supplier selection
Example 2: success!
Example 3: the detailed table
Example 4: the filter menu
Example 5: the filter in action