public void run(){
				final JFrame frame1 = new JFrame("Login");
		        final JButton btnLogin = new JButton("Click to login");
		        final LoginDialog loginDlg = new LoginDialog(frame1);
		        
		        frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		        
		        btnLogin.addActionListener(
		                new ActionListener(){
		                    public void actionPerformed(ActionEvent e) {
		                        
		                        loginDlg.setVisible(true);
		                        // if logon successfully
		                        if(loginDlg.isSucceeded()){

		                        	frame1.dispose();
		                        	JFrame frame = new MainFrame("Prison Database", loginDlg.getConnection(), loginDlg.getStatement());
		            				frame.setSize(1500,740);
		            				frame.setLocationRelativeTo(null);
		            				frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		            				frame.setVisible(true);
		                        }
		                    }
		                });
		 
		        frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		        frame1.setLocationRelativeTo(null);
		        frame1.setSize(300, 100);
		        frame1.setLayout(new FlowLayout());
		        frame1.getContentPane().add(btnLogin);
		        frame1.setVisible(true);
		        
		     
			}