用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字
云代码 - java代码库

注册界面

2014-05-10 作者: 云代码会员举报

[java]代码库

//注册
package com.view;
 
import java.awt.Color;
 
/**
 * 注册界面
 * @author wb2xin
 *
 */
public class InTo_Insert extends JFrame implements ActionListener{
 
    /**
     * 成员变量
     */
    private static final long serialVersionUID = 1L;
    private JPanel contentPane;
    //北部
    JLabel topImg;
    private JTextField idTex;
    private JTextField ageTex;
    private JButton insertBut,exitBut;
    private JTextField nameTex;
    private JPasswordField pswTex;
    private JPasswordField pswTex1;
    private JTextField pageTex;
    /**
     * new 出注册界面
     */
    public static void main(String[] args) {
     
        InTo_Insert frame = new InTo_Insert();
        frame.setVisible(true);
     
    }
 
    /**
     * 构造函数初始化
     */
    public InTo_Insert() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setSize(694, 498);
        this.setLocationRelativeTo(null);//居中
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        setContentPane(contentPane);
        contentPane.setLayout(null);
         
        /**
         * top
         */
        JLabel topImage = new JLabel(new ImageIcon("image/welcome小.gif"));
        topImage.setBounds(395, 0, 283, 124);
        contentPane.add(topImage);
         
        topImg = new JLabel(new ImageIcon("image/注册top.jpg"));
        topImg.setBounds(0, 0, 678, 124);
        topImg.setBackground(Color.PINK);
        contentPane.add(topImg);
         
        /**
         * 中部
         */
        JLabel idLab = new JLabel("ID:");
        idLab.setHorizontalAlignment(SwingConstants.RIGHT);
        idLab.setBounds(32, 134, 52, 31);
        contentPane.add(idLab);
         
        idTex = new JTextField();
        idTex.setBounds(87, 134, 83, 31);
        contentPane.add(idTex);
        idTex.setColumns(10);
         
        JLabel nameLab = new JLabel("姓名:");
        nameLab.setBounds(193, 134, 53, 31);
        contentPane.add(nameLab);
         
        nameTex = new JTextField();
        nameTex.setColumns(10);
        nameTex.setBounds(241, 134, 83, 31);
        contentPane.add(nameTex);
         
        JLabel sexLab = new JLabel("性别:");
        sexLab.setBounds(334, 134, 53, 31);
        contentPane.add(sexLab);
         
        JRadioButton sexRadio1 = new JRadioButton("男");
        sexRadio1.setBounds(373, 134, 53, 31);
        sexRadio1.setOpaque(false);
        //
        JRadioButton sexRadio2 = new JRadioButton("女");
        sexRadio2.setBounds(415, 134, 53, 31);
        sexRadio2.setOpaque(false);
        //
        ButtonGroup bg=new ButtonGroup();///
        bg.add(sexRadio1);///////
        bg.add(sexRadio2);//////////////
        sexRadio1.setSelected(true);///设置默认选项
         
        contentPane.add(sexRadio1);
        contentPane.add(sexRadio2);
         
        JLabel statusLab = new JLabel("申请权限:");
        statusLab.setBounds(474, 134, 77, 31);
        contentPane.add(statusLab);
         
        JComboBox<Object> statusBox = new JComboBox<Object>();
        statusBox.setBounds(541, 134, 107, 31);
        statusBox.addItem("管理员");
        statusBox.addItem("学生");
        contentPane.add(statusBox);
         
        JLabel pswLab = new JLabel("密码:");
        pswLab.setHorizontalAlignment(SwingConstants.RIGHT);
        pswLab.setBounds(32, 191, 52, 31);
        contentPane.add(pswLab);
         
        pswTex = new JPasswordField();
        pswTex.setBounds(87, 191, 140, 31);
        contentPane.add(pswTex);
         
        JLabel pswLab1 = new JLabel("密码确认:");
        pswLab1.setBounds(247, 191, 77, 31);
        contentPane.add(pswLab1);
         
        pswTex1 = new JPasswordField();
        pswTex1.setBounds(315, 191, 140, 31);
        contentPane.add(pswTex1);
         
        JLabel ageLab = new JLabel("年龄:");
        ageLab.setHorizontalAlignment(SwingConstants.CENTER);
        ageLab.setBounds(465, 191, 53, 31);
        contentPane.add(ageLab);
         
        ageTex = new JTextField();
        ageTex.setColumns(10);
        ageTex.setBounds(514, 191, 53, 31);
        contentPane.add(ageTex);
         
        JLabel ageTxet = new JLabel("岁");
        ageTxet.setHorizontalAlignment(SwingConstants.CENTER);
        ageTxet.setBounds(567, 191, 36, 31);
        contentPane.add(ageTxet);
         
        JLabel pageLab = new JLabel("验证码:");
        pageLab.setHorizontalAlignment(SwingConstants.RIGHT);
        pageLab.setBounds(32, 251, 52, 31);
        contentPane.add(pageLab);
         
        pageTex = new JTextField();
        pageTex.setColumns(10);
        pageTex.setBounds(87, 251, 66, 31);
        contentPane.add(pageTex);
         
        JLabel explainLab = new JLabel("个人说明:");
        explainLab.setHorizontalAlignment(SwingConstants.LEFT);
        explainLab.setBounds(45, 281, 83, 31);
        contentPane.add(explainLab);
         
        JScrollPane scrollPane = new JScrollPane();
        scrollPane.setBounds(43, 312, 593, 78);
        contentPane.add(scrollPane);
         
        JTextArea textArea = new JTextArea();
        scrollPane.setViewportView(textArea);
         
        insertBut = new JButton("注册");
        insertBut.setBounds(121, 411, 77, 31);
        insertBut.addActionListener(this);//监听1
        contentPane.add(insertBut);
         
        exitBut = new JButton("返回");
        exitBut.setBounds(482, 411, 77, 31);
        exitBut.addActionListener(this);//监听1
        contentPane.add(exitBut);
         
         
         
        this.setVisible(true);
    }
///////////////////////////////////////////////////////注册监听器1
    @Override
    public void actionPerformed(ActionEvent de) {
        // TODO Auto-generated method stub
        if(de.getSource()==insertBut){
            //注册
             
        }else if(de.getSource()==exitBut){
            //返回
        }
         
    }
}


网友评论    (发表评论)


发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。


扫码下载

加载中,请稍后...

输入口令后可复制整站源码

加载中,请稍后...