import java.awt.BorderLayout;
import javax.swing.*;
class Win extends JFrame{
JButton jButton1,jButton2;
JLabel jLabel1,jLabel2;
JTextArea jTextArea1;
public Win(){
setLayout(new BorderLayout());
setTitle("BorderLayout布局应用");
jButton1 = new JButton("左西");
jButton2 = new JButton("右东");
jLabel1 = new JLabel("下南");
jLabel2 = new JLabel("上北");
jTextArea1 = new JTextArea("中");
          add(jButton1, java.awt.BorderLayout.WEST);
          add(jButton2, java.awt.BorderLayout.EAST);
          add(jLabel1, java.awt.BorderLayout.NORTH);
add(jLabel2, java.awt.BorderLayout.SOUTH);
add(jTextArea1, java.awt.BorderLayout.CENTER);
setBounds(200, 200,200, 200);
validate();
setVisible(true);
    }
}
class BorderLayout_test{
public static void main(String args[]){
     new Win();
   }
}
