From 586e6d473eb1de2c7bba09cedf1969740d3c06bf Mon Sep 17 00:00:00 2001 From: Gavin Li Date: Mon, 23 Feb 2015 16:26:54 -0500 Subject: [PATCH] Updated TransactionUI --- MerchantRPGCSE2102/src/view/TransactionUI.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/MerchantRPGCSE2102/src/view/TransactionUI.java b/MerchantRPGCSE2102/src/view/TransactionUI.java index 71d4679..8bf6202 100644 --- a/MerchantRPGCSE2102/src/view/TransactionUI.java +++ b/MerchantRPGCSE2102/src/view/TransactionUI.java @@ -75,6 +75,7 @@ public void mouseClicked(MouseEvent arg0) { @Override public void mouseClicked(MouseEvent e) { System.out.println("SELL"); //temporary test code + createSellWindow(); } }); btnSell.setBounds(351, 155, 169, 105); @@ -105,7 +106,7 @@ public void mouseClicked(MouseEvent e) { /** * Will exit the transaction window */ - public void exitWindow() + public static void exitWindow() { System.exit(0); } @@ -126,7 +127,10 @@ public void run() frame.setBounds(100, 100, 600, 900); JPanel contentPane = new JPanel(); contentPane = new JPanel(); - contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS)); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + frame.setContentPane(contentPane); + contentPane.setLayout(null); + frame.setVisible(true); } }); @@ -138,6 +142,15 @@ public void run() */ public static void createSellWindow() { + JFrame frame = new JFrame("Sell"); + frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + frame.setBounds(100, 100, 600, 900); + JPanel contentPane = new JPanel(); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + frame.setContentPane(contentPane); + contentPane.setLayout(null); + frame.setVisible(true); } }