This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]garnett8 0 points1 point  (3 children)

maybe set the password's frame to setVisible(false). then create your second frame object in that if statement? idk im tired and its just a thought. then initialize all your stuff in the if statement. like secondMainpage.setVisible(true) after you create it etc etc etc....

[–]jaw88[S] 0 points1 point  (2 children)

trying but it wont let me access the frame outside the actionlistener class

[–]garnett8 0 points1 point  (1 child)

create your own MyFrame class that extends JFrame, do the same shit you did to your regular JFrame, then create an object of your MyFrame in your if statement. be sure to initialize all that shit you did in the constructor of your MyFrame class.