//Boundary layout ManagerImportjava.awt.*;Importjavax.swing.*; Public classJiemian1extendsjframe{//Defining ComponentsJButton An1,an2,an3,an4,an5; Public Static voidMain (string[] args) {//to run this class of construction methodsJiemian1 Jiemian =NewJiemian1 (); } PublicJiemian1 () {//Create buttonAn1 =NewJButton ("Orient"); An2=NewJButton ("The West"); AN3=NewJButton ("South"); An4=NewJButton ("North"); An5=NewJButton ("China")); //Add button This. Add (An1,borderlayout.east); This. Add (An2,borderlayout.west); This. Add (An3,borderlayout.south); This. Add (An4,borderlayout.north); This. Add (An5,borderlayout.center); //The Chinese side has the biggest authority, if not the other direction, will be occupied by China, if not, the other direction will not occupy China//Set Window caption This. Settitle ("Border layout borderlayout"); //Set the width height of the window This. SetSize (300,300); //The Settings window appears for the location of the screen This. setlocation (100,100); //releasing a resource after closing a window This. Setdefaultcloseoperation (Jframe.exit_on_close); //Output Window This. setvisible (true); } }
JAVA Boundary layout Manager