zoukankan      html  css  js  c++  java
  • 学习java心得 二

    import java.awt.Container;
    import java.awt.FlowLayout;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.SwingConstants;
    
    public class Login {
        private JFrame frm;
          public static void main(String[] args)
        {
            
          JFrame frm =new JFrame("邮箱登录界面");
          Container contentPane = frm.getContentPane();
        //获得框架中的内容面板
          contentPane.setLayout(new FlowLayout());
          
          JLabel show = new JLabel();
          show.setText("请输入账号");
          frm.add(show);
          
          String[]things={"1362362@163.com","1561236@163.com","1314521@163.com","5211314@163.com"};
          JComboBox comboBox=new  JComboBox(things);
          frm.add(comboBox);
    
          JButton Btn=new JButton("确定");
          frm.add(Btn);
              
               JLabel show1= new JLabel();
             show1.setText("请输入密码");
            
             frm.add(show1);
             
         JTextField input =new JTextField();
         input.setEditable(true);
         input.setHorizontalAlignment(SwingConstants.LEFT);
         input.setColumns(20);
         frm.add( input);
                 
         JButton loginBtn=new JButton("登录");
        
         frm.add(loginBtn);
      frm.setBounds(400,200,300,160); frm.setVisible(
    true); }}

     这周我们学习了使用复选框,和事件响应,这让我感觉到了java的无穷魅力。学习了这些内容之后呢我做了一个简单的邮箱登录界面。代码如上: 

  • 相关阅读:
    一个空类会生成哪些默认函数
    What is VMR(Video Mixing Render)From MSDN
    DirectX backface culling(背面剔除)
    D3DPOOL(资源池)
    两道概率题供大家周末把玩
    空间两点间的距离
    n != n, n == n
    C++默认参数
    D3DPT_TRIANGLELIST与D3DPT_TRIANGLESTRIP
    D3D中的设备丢失
  • 原文地址:https://www.cnblogs.com/jinnanjun/p/5303391.html
Copyright © 2011-2022 走看看