Day 4:qqreg.java

Source: Internet
Author: User

Import java.awt.*;
Import javax.swing.*;

public class Qqreg extends jframe{
public static void Main (string[] args) {
Qqreg w = new Qqreg ();
W.setvisible (TRUE);
}
Qqreg () {
Set up basic information for a form
This.setsize (660, 380);
This.setlocationrelativeto (NULL);
This.settitle ("Talking.GHOUL.Reg");
This.setresizable (FALSE);
This.seticonimage (This.gettoolkit (). GetImage ("D:/LAB_2/PSB (one). jpg"));
New Components & Setup Components
JLabel labtitle = new JLabel ("Sign Up");
Labtitle.setfont (New Font ("", 0, 36));

JLabel labuser = new JLabel ("Username");
Labuser.setfont (New Font ("", 0, 30));
JLabel Labpass = new JLabel ("Password");
Labpass.setfont (New Font ("", 0, 30));
JLabel labpassre = new JLabel ("Confirm Password");
Labpassre.setfont (New Font ("", 0, 30));

JComboBox cmbusername = new JComboBox ();
Cmbusername.setfont (New Font ("", 0, 30));
Cmbusername.additem ("かねきけん");
Cmbusername.additem ("Kaneki Ken");
Cmbusername.additem ("Jinmu");

JPasswordField Txtpass = new JPasswordField ();
Txtpass.setfont (New Font ("", 0, 25));
JPasswordField txtpassre = new JPasswordField ();
Txtpassre.setfont (New Font ("", 0, 25));

JButton Btnreg = new JButton ("CONFIRM");
Btnreg.setfont (New Font ("", 0, 30));
Layout the main panel
JPanel panuser = new JPanel ();
Panuser.setlayout (New GridLayout (3, 3));

Panuser.add (Labuser);
Panuser.add (Cmbusername);
Panuser.add (Labpass);
Panuser.add (Txtpass);
Panuser.add (LABPASSRE);
Panuser.add (TXTPASSRE);
Layout button panel
JPanel Panbutton = new JPanel ();
Panbutton.setlayout (New FlowLayout ());

Panbutton.add (Btnreg);
Layout form
This.setlayout (New BorderLayout ());

This.add (Labtitle, Borderlayout.north);
This.add (Panuser, Borderlayout.center);
This.add (Panbutton, Borderlayout.south);
}
}

Day 4:qqreg.java

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.