Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // nomor limaaaa
- package testest;
- import java.awt.BorderLayout;
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.GridLayout;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.MouseEvent;
- import java.util.Vector;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.JScrollPane;
- import javax.swing.JSpinner;
- import javax.swing.JTable;
- import javax.swing.SpinnerModel;
- import javax.swing.SpinnerNumberModel;
- import javax.swing.table.DefaultTableModel;
- import javax.swing.table.TableCellRenderer;
- import javax.swing.table.TableColumnModel;
- public class NoLima extends JFrame implements ActionListener{
- JPanel panelHeaderTransactionHistory, panelContentTransactionHistory, panelFooterTransactionHistory;
- JLabel lblTitle;
- JTable table;
- JFrame TransactionHistory;
- Vector tableHeader;
- Vector<Vector> tableContent;
- DefaultTableModel model;
- void TransactionHistory() {
- TransactionHistory = new JFrame();
- panelHeaderTransactionHistory = new JPanel();
- panelContentTransactionHistory = new JPanel();
- panelFooterTransactionHistory = new JPanel();
- //header
- lblTitle = new JLabel("Transaction History");
- panelHeaderTransactionHistory.add(lblTitle);
- //content
- tableHeader = new Vector();
- tableHeader.add("TransactionID");
- tableHeader.add("Clothes Name");
- tableHeader.add("Clothes Type");
- tableHeader.add("Brand");
- tableHeader.add("Transaction Date");
- tableHeader.add("Quantity");
- tableHeader.add("Price");
- tableHeader.add("Status");
- tableContent = new Vector();
- model = new DefaultTableModel(tableContent, tableHeader);
- JTable table = new JTable(model);
- table = new JTable();
- table.setModel(model);
- JScrollPane scroll = new JScrollPane(table);
- panelContentTransactionHistory.add(scroll);
- scroll.setPreferredSize(new Dimension(900,950));
- GridLayout experimentLayout = new GridLayout(0,2);
- panelFooterTransactionHistory.setLayout(experimentLayout);
- TransactionHistory.add(panelHeaderTransactionHistory, BorderLayout.NORTH);
- TransactionHistory.add(panelContentTransactionHistory, BorderLayout.CENTER);
- TransactionHistory.add(panelFooterTransactionHistory, BorderLayout.SOUTH);
- TransactionHistory.setSize(900,950);
- TransactionHistory.setTitle("Transaction History");
- TransactionHistory.setDefaultCloseOperation(EXIT_ON_CLOSE);
- TransactionHistory.setVisible(true);
- TransactionHistory.setLocationRelativeTo(null);
- panelContentTransactionHistory.setSize(100,100);
- }
- public NoLima() {
- TransactionHistory();
- }
- public static void main(String[] args) {
- new NoLima();
- }
- @Override
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement