Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. package AuctionHome;
  2.  
  3. import java.awt.EventQueue;
  4. import java.awt.event.ActionEvent;
  5. import java.awt.event.ActionListener;
  6.  
  7. import javax.swing.JButton;
  8. import javax.swing.JFrame;
  9. import javax.swing.JLabel;
  10.  
  11. import LoginSystem.LoginSystem;
  12. import java.awt.Font;
  13. import java.awt.GridLayout;
  14. import javax.swing.SwingConstants;
  15. import javax.swing.JSeparator;
  16.  
  17.  
  18.  
  19. public class AuctionHome {
  20.  
  21. private JFrame AuctionHome;
  22.  
  23. /**
  24. * Launch the application.
  25. */
  26. public static void main(String[] args) {
  27. EventQueue.invokeLater(new Runnable() {
  28. public void run() {
  29. try {
  30. AuctionHome window = new AuctionHome();
  31. window.AuctionHome.setVisible(true);
  32. } catch (Exception e) {
  33. e.printStackTrace();
  34. }
  35. }
  36. });
  37. }
  38.  
  39. /**
  40. * Create the application.
  41. */
  42. public AuctionHome() {
  43. initialize();
  44. }
  45.  
  46. /**
  47. * Initialize the contents of the frame.
  48. */
  49. private void initialize() {
  50. //Creates new frame
  51. AuctionHome = new JFrame();
  52. AuctionHome.setBounds(100, 100, 1009, 701);
  53. AuctionHome.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  54. AuctionHome.getContentPane().setLayout(null);
  55.  
  56. //Auction Home Text
  57. JLabel lblAuctionHome = new JLabel("Auction Home");
  58. lblAuctionHome.setBounds(259, 0, 437, 98);
  59. lblAuctionHome.setFont(new Font("Microsoft YaHei UI Light", Font.PLAIN, 60));
  60. AuctionHome.getContentPane().add(lblAuctionHome);
  61.  
  62.  
  63. //Displays what user you are logged in as
  64. JLabel lblLoggedInAs = new JLabel("Hello, " + LoginSystem.username);
  65. lblLoggedInAs.setFont(new Font("Microsoft YaHei Light", Font.PLAIN, 20));
  66. lblLoggedInAs.setBounds(12, 11, 386, 87);
  67. AuctionHome.getContentPane().add(lblLoggedInAs);
  68.  
  69. //Logout button
  70. JButton btnLogout = new JButton("LOGOUT");
  71. btnLogout.setBounds(750, 40, 198, 36);
  72. btnLogout.addActionListener(new ActionListener() {
  73. public void actionPerformed(ActionEvent arg0)
  74. {
  75.  
  76.  
  77. //Closes AuctionHome and opens loginSystem
  78. AuctionHome.dispose();
  79. LoginSystem.main(null);
  80.  
  81.  
  82.  
  83. }
  84. });
  85. AuctionHome.getContentPane().add(btnLogout);
  86.  
  87. JSeparator separator = new JSeparator();
  88. separator.setBounds(0, 100, 991, 2);
  89. AuctionHome.getContentPane().add(separator);
  90. }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement