diff --git a/src/panels/ShowHistoryPanel.java b/src/panels/ShowHistoryPanel.java index acd6a7d..d365585 100644 --- a/src/panels/ShowHistoryPanel.java +++ b/src/panels/ShowHistoryPanel.java @@ -1,30 +1,19 @@ package panels; import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.HashMap; import javax.swing.BoxLayout; import javax.swing.DefaultListModel; import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.JFormattedTextField; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.JTable; import javax.swing.JTextField; -import javax.swing.border.Border; -import javax.swing.table.DefaultTableModel; import frames.IMainFrame; -import frames.MainFrame; import resources.Customer; import resources.CustomersModel; @@ -67,30 +56,33 @@ historiesListModel = new DefaultListModel(); historiesList = new JList(historiesListModel); -// this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + BoxLayout layout = new BoxLayout(this, BoxLayout.Y_AXIS); + this.setLayout(layout); - // add labels + // nameLabel = new JLabel(); - add(nameLabel, BorderLayout.NORTH); + nameLabel.setAlignmentX(CENTER_ALIGNMENT); + add(nameLabel); // add scroll menu JScrollPane scrollPanel = new JScrollPane(historiesList); - add(scrollPanel, BorderLayout.CENTER); - + add(scrollPanel); + // add payment fields - textField = new JTextField(1); + JLabel inputLabel = new JLabel("payment?"); + textField = new JTextField(25); payButton = new JButton("Payment"); + backButton = new JButton("Back"); + backButton.setAlignmentX(CENTER_ALIGNMENT); JPanel panel = new JPanel(); - panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); + panel.add(inputLabel); + panel.add(textField); panel.add(payButton); - panel.add(textField, new Dimension(1,1)); - add(panel); + panel.add(backButton); - // add back button - backButton = new JButton("Back"); - add(backButton, BorderLayout.NORTH); - + add(panel); + add(backButton); // add listener backButton.addActionListener(new BackActionHandler());