Implementation of the Java Landing window

Source: Internet
Author: User

Tag:public    user name    frame   null   import    

import javax.swing.*;/** * created by administrator on 2015/4/13 0013.  * <p> *  absolute positioning of components   :   using   Compontent   The setbounds   method in the class  * <p> * <p> * setbounds x y    represents the position of the component    width height    the height of the component  */public class  Chap15_10 {    public static void main (String[] args)  {         jframe frame = new jframe ("Landing window");         frame.setlayout (NULL);         jlabel lblogin = new jlabel ("User name");         Jtextfield textlogin = new jtextfield ();         jlabel lbpassword = New jlabel ("password");         jtextfield textpassword =  new jtextfield ();        jbutton btncon =  New jbutton ("Connection");         jbutton btnexit = new  jbutton ("Exit");        jbutton btnpro = new  JButton ("attribute");         //container size position definition          frame.setsize (400, 200);         frame.setlocation (300 ,  200);         //user name     and input box   positioning          lblogin.setbounds (45,5,50,20);         textlogin.setbounds (100, 5, 210, 20);         Lbpassword.setbounds (45, 35,&NBSP;50,&NBSP;20);         textpassword.setbounds (100, 35, &NBSP;210,&NBSP;20);         btncon.setbounds (45, 100, 80, &NBSP;20);         btnexit.setbounds (130,&NBSP;100,&NBSP;80,&NBSP;20);         btnpro.setbounds (220, 100, 80, 20);         frame.add (Lblogin);         Frame.add (Textlogin);         frame.add (LbPassword);         frame.add (Textpassword);         Frame.add (Btncon);         frame.add (Btnexit);         frame.add (Btnpro);         frame.setvisible ( true);     }}


The implementation is:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6B/5F/wKiom1UryMbzHoAuAACGOOjBy84302.jpg "title=" capture. PNG "alt=" Wkiom1urymbzhoauaacgoojby84302.jpg "/>



This article is from the "Monkey Moving Brick" blog, please be sure to keep this source http://silianbo.blog.51cto.com/6627757/1632018

Implementation of the Java Landing window

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.