I have a small problem: I created a JFrame and I added others components in there. Among these components there is a JButton called deletme. I want to when I click that deletme button the frame stays there but only its components go away. I wrote this as a trick:
deletme.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
dispose();
aaa x=new aaa();}
( aaa inherits from JFrame and it looks exactly like the Class JFrame I'm working on but the only difference is that it's without components). but this makes it clear the the frame is closed and reopened again. Guys is there any solution to make it work?!
[sorry for my bad english}