I have two User Interface classes - Class A and Class B I have Class A calling Class B by a button. When I close Class B it closes Class A, what I wanted is to go back to Class A and not close it. Please Help, Thank You
ClassB app = new ClassB(); app.setVisible(true); } } ); container.add(button1); setSize(400,400); setVisible(true); } } Another Class: import java.awt.event.*; import javax.swing.*; public class ClassB extends JFrame { public ClassB() {
super("Hello World"); Container container = getContentPane(); JButton button2 = new JButton("Button 2"); container.add(button1); setSize(400,400); setVisible(true); } } When I hit "Button 1" in Class A it will show ClassB, but when I close ClassB it closes Class A also. My question is is there a way I can ONLY close ClassB. Hopefully this helps.
Post by:autobot
Can you really tell me that we aren't dealing with suspicious baked goods? And then there is this tiny ad:
a bit of art, as a gift, the permaculture playing cards