各位大虾救命呀
import java.awt.*;
public class YourFrame extends Frame
{
private Panel borderPanel;
private Panel flowPanel;
private Panel gridPanel;
private Panel cardPanel;
public YourFrame(String title)
{
super(title);
setSize(600,400);
setLocation(100,100);
setBorderLayoutPanel();
setFlowLayoutPanel();
setGridLayoutPanel();
setCardLayoutPanel();
setLayout(new GridLayout(2,2));
add(borderPanel);
add(flowPanel);
add(gridPanel);
add(cardPanel);
addWindListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
public void setBorderLayoutPanel()
{
borderPanel=new Panel();
borderPanel.setLayout(new BorderLayout());
Button btn1=new Button( "North ");
Button btn2=new Button( "South ");