Working with 2 or more frames
问题 I have about 3 frames in my java swing application. What it the correct way how to handle with these frames? I mean some pattern or something else. Now I have always one class which represent frame and one class for panel which is main in this frame. Now I have defined frames as static variable and when I wanna hide them I call classname.frameName.setVisible(false); is this the correct solution? 回答1: Besides the (excellent) suggestions of a CardLayout or JFrame with multiple JDialog instances