Hi...I am building an application where I need to call a second frame based on the user clicking on a button on the first frame. Could someone give me an idea what code would instantiate the second frame? I have the Actionperformed method set up for the button. Thanks.
I am still having trouble with the concept of getting this to work. I have a main class that sets up the frame for the JFrame (Login) class and then calls itself to start the application. This then starts the Login screen. I have a button on the login screen that I want to call up a change password frame. I placed the 'new ChangePassword()' code in the ActionEvent method of the change password button but the new frame is not coming up. thanks again for you help.
Well, whether "new ChangePassword()" is enough or not depends on what the ChangePassword constructor does. Some JFrame subclasses call setVisible(true) , for example, while some don't. If your JFrame class doesn't automatically make itself visible in this way, then you'll need another line of code to do that. But my point is that there's nothing special here: you just create the class and set it up in the same way that you created and set up the first frame in your application -- except that you do it in an event handler.