Skip to content
Advertisement

Close window after checking

I’m having a slight issue, and I can’t figure it out. I want for my code to check if the email and password matches and then close the window. This the action:

JavaScript

Advertisement

Answer

I am going to assume you have an issue with opening a new frame and disposing of the login frame, because if you have an issue with user validation there isn’t enough information for any of us to actually help.

Also, please read this concerning the use of multiple JFrames. The Use of Multiple JFrames: Good or Bad Practice?

Now for the code section…

Once user validation is done, you need to create an instance of your main window and make it visible. After that you can close the first JFrame.

Your actionPerformed would look something like this:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement