Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package AuctionHome;
- import java.awt.EventQueue;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import LoginSystem.LoginSystem;
- import java.awt.Font;
- import java.awt.GridLayout;
- import javax.swing.SwingConstants;
- import javax.swing.JSeparator;
- public class AuctionHome {
- private JFrame AuctionHome;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- AuctionHome window = new AuctionHome();
- window.AuctionHome.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the application.
- */
- public AuctionHome() {
- initialize();
- }
- /**
- * Initialize the contents of the frame.
- */
- private void initialize() {
- //Creates new frame
- AuctionHome = new JFrame();
- AuctionHome.setBounds(100, 100, 1009, 701);
- AuctionHome.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- AuctionHome.getContentPane().setLayout(null);
- //Auction Home Text
- JLabel lblAuctionHome = new JLabel("Auction Home");
- lblAuctionHome.setBounds(259, 0, 437, 98);
- lblAuctionHome.setFont(new Font("Microsoft YaHei UI Light", Font.PLAIN, 60));
- AuctionHome.getContentPane().add(lblAuctionHome);
- //Displays what user you are logged in as
- JLabel lblLoggedInAs = new JLabel("Hello, " + LoginSystem.username);
- lblLoggedInAs.setFont(new Font("Microsoft YaHei Light", Font.PLAIN, 20));
- lblLoggedInAs.setBounds(12, 11, 386, 87);
- AuctionHome.getContentPane().add(lblLoggedInAs);
- //Logout button
- JButton btnLogout = new JButton("LOGOUT");
- btnLogout.setBounds(750, 40, 198, 36);
- btnLogout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0)
- {
- //Closes AuctionHome and opens loginSystem
- AuctionHome.dispose();
- LoginSystem.main(null);
- }
- });
- AuctionHome.getContentPane().add(btnLogout);
- JSeparator separator = new JSeparator();
- separator.setBounds(0, 100, 991, 2);
- AuctionHome.getContentPane().add(separator);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement