zoukankan      html  css  js  c++  java
  • 2016/04/20

    package com.wode.test;

    import java.awt.Container;

    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JPasswordField;
    import javax.swing.JRadioButton;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextField;

    public class Student extends JFrame{

     public Student(String title){
      super(title);
      Container c=this.getContentPane();
      this.setSize(400, 300);
      this.setLocationRelativeTo(null);
      this.setLayout(null);
      this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      this.setResizable(false);
      JLabel jLabelName = new JLabel("用户名:");
      JLabel jLabelpassword = new JLabel("密码:");
      JPanel jPanel = new JPanel();  
      jPanel.setLayout(null);  
      jPanel.setBounds(1, 1, 400, 300);
      jLabelName.setBounds(100, 65, 60, 20);
      jLabelpassword.setBounds(100, 120, 60, 20);
      jPanel.add(jLabelpassword);
      jPanel.add(jLabelName);
      JTextField txtName = new JTextField();
      txtName.setBounds(180, 65, 85, 20);
      jPanel.add(txtName);
      JPasswordField txtpassword = new JPasswordField();
      txtpassword.setBounds(180, 120, 85, 20);
      jPanel.add(txtpassword);
      JButton okbtn=new JButton("确定");
      okbtn.setBounds(110, 200, 60, 40);
      jPanel.add(okbtn);
      JButton cancelbtn=new JButton("取消");
      cancelbtn.setBounds(220, 200, 60, 40);
      jPanel.add(cancelbtn);
      JRadioButton supervise = new JRadioButton("管理登陆");
      supervise.setBounds(100,25, 120, 20);
      jPanel.add(supervise);
      JRadioButton studnet = new JRadioButton("学生登陆");
      studnet.setBounds(220,25, 120, 20);
      jPanel.add(studnet);
      JLabel newName = new JLabel("注册账号");
      newName.setBounds(280, 65, 60, 20);
      jPanel.add(newName);
      JLabel password = new JLabel("密码找回");
      password.setBounds(280, 120, 60, 20);
      jPanel.add(password);
      JCheckBox remember = new JCheckBox("记住密码");
      remember.setBounds(110, 160, 110, 20);
      jPanel.add(remember);
      JCheckBox automatic = new JCheckBox("自动登陆");
      automatic.setBounds(225, 160, 110, 20);
      jPanel.add(automatic);
      this.add(jPanel);
      this.setVisible(true);
      
     }
     public static void main(String[] args) {
      new Student("学生管理系统");
     }
    }

  • 相关阅读:
    兼容火狐几秒后跳转页面
    js 利用sina ip库获取ip及通信服务商
    jQuery.validate 中文API
    s:select标签的Map形式使用
    【原创随笔】reCAPTCHA加密验证Email地址,正确才可完整查看地址!
    eclipse编辑jsp文件和javascript代码很卡解决办法
    oracle 10 R2 静默安装 + psu
    【容易成功的十种能力你具备几种
    CentOS 新虚拟机网卡设置
    【与人沟通的技巧很重要】
  • 原文地址:https://www.cnblogs.com/chenyangpeng/p/5414511.html
Copyright © 2011-2022 走看看