import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
public class ShowFrame extends JFrame implements ActionListener {
private JButton b;
private JPanel p;
public ShowFrame(String title) {
super(title);
p = new JPanel();
b = new JButton(\"Show\");
b.addActionListener(this);
p.add(b);
getContentPane().add(p);
}
public void actionPerformed(ActionEvent e) {
new TempFrame(this);
}
public static void main(String[] args) {
ShowFrame f = new ShowFrame(\"ShowFrame\");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(200,400);
f.setVisible(true);
}
}
class TempFrame extends JDialog {
public TempFrame(ShowFrame f) {
super(f,\"Temp\",true);
setSize(100,100);
setVisible(true);
}
}