How to make Jframe button open another Jframe screen in Netbeans

Viewed 263

I have a Jframe and i need to link it to another Jframe if button is clicked it goes to another Jframe screen on click and closes old screen. accully i want if user click login register then it goes to login screen for getting login i am newbie and a bigginner kindly help me P.S its my first Qestion at Stack so ignore mistakes.

1 Answers

Double Click the Register Button in the NETBEANS or add the Event Listener on Click Event (ActionListener)

btnLogin.addActionListener(new ActionListener() 
{
    public void actionPerformed(ActionEvent e) {
        this.setVisible(false);
        new FrmMain().setVisible(true); // Main Form to show after the Login Form..
    }
});
Related