Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. package login;
  2.  
  3. import java.awt.Cursor;
  4.  
  5. public class Frame_Utama {
  6.  
  7.     public JFrame frame_utama;
  8.     private JButton btnLogOut;
  9.  
  10.     public static void main(String[] args) {
  11.         EventQueue.invokeLater(new Runnable() {
  12.             public void run() {
  13.                 try {
  14.                     Frame_Utama window = new Frame_Utama();
  15.                     window.frame_utama.setVisible(true);
  16.                 } catch (Exception e) {
  17.                     e.printStackTrace();
  18.                 }
  19.             }
  20.         });
  21.     }
  22.  
  23.  
  24.     public Frame_Utama() {
  25.         initialize();
  26.     }
  27.  
  28.  
  29.     private void initialize() {
  30.         frame_utama = new JFrame();
  31.         frame_utama.getContentPane().setFont(new Font("Verdana", Font.PLAIN, 12));
  32.         frame_utama.getContentPane().setLayout(null);
  33.         frame_utama.setBounds(100, 100, 450, 300);
  34.         frame_utama.setTitle("Frame Utama");
  35.         frame_utama.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  36.         frame_utama.setExtendedState(JFrame.MAXIMIZED_BOTH);
  37.        
  38.         btnLogOut = new JButton("LOG OUT");
  39.         btnLogOut.addActionListener(new ActionListener() {
  40.             public void actionPerformed(ActionEvent arg0) {
  41.                 // Event Button Log Out
  42.                 Frame_Login fl = new Frame_Login();
  43.                 fl.frame_login.setVisible(true);
  44.                 frame_utama.setVisible(false);
  45.             }
  46.         });
  47.         btnLogOut.setFont(new Font("Verdana", Font.PLAIN, 12));
  48.         btnLogOut.setBounds(106, 111, 106, 40);
  49.         btnLogOut.setCursor(new Cursor(Cursor.HAND_CURSOR));
  50.         frame_utama.getContentPane().add(btnLogOut);
  51.     }
  52.  
  53. }