I described that in post #2:
JFrame frame2 = new JFrame(); // Create second JFrame
After the instance of JFrame is created, the code needs to add components to it and call the setVisible()...
Type: Posts; User: Norm
I described that in post #2:
JFrame frame2 = new JFrame(); // Create second JFrame
After the instance of JFrame is created, the code needs to add components to it and call the setVisible()...
The new statement is used to create an instance of a class.
That code does NOT create a JFrame. It looks like a constuctor for a class that was created somewhere else.
A class instance/object is created by a new statement. Somewhere there is a call to new...
Use the new statement:
frame1 = new JFrame();
frame2 = new JFrame(); // Create second JFrame