A problem in displaying panel
the program below doesn't display the button until i maximize the frame
i just don't know what to do!!!
//
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class MyFrame extends JFrame
{
public MyFrame()
{
super("Test");
setSize(600,400);
setLocation(100,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
JPanel p = new JPanel();
getContentPane().add(p);
JButton b = new JButton("Hello Java");
p.add(b);
}
}
public class MainTest
{
public static void main(String[] args)
{
MyFrame f = new MyFrame();
}
}

