JAVA Boundary layout Manager

Source: Internet
Author: User

//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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.