[Java] QQ →→→→→进入此内容的聊天室

来自 , 2019-10-16, 写在 Java, 查看 111 次.
URL http://www.code666.cn/view/67d16d00
  1. package client.frame;
  2.  
  3. import java.awt.EventQueue;
  4. import javax.swing.JFrame;
  5. import javax.swing.JPanel;
  6. import javax.swing.border.EmptyBorder;
  7. import client.frame.MyPanel;
  8. import javax.swing.JLabel;
  9. //import com.sun.awt.AWTUtilities;
  10. import javax.swing.JPasswordField;
  11. import javax.swing.JComboBox;
  12. import java.awt.Font;
  13. import java.awt.Color;
  14. import javax.swing.ImageIcon;
  15. import javax.swing.JCheckBox;
  16. import javax.swing.JTextField;
  17. import java.awt.Toolkit;
  18. import java.awt.event.MouseAdapter;
  19. import java.awt.event.MouseEvent;
  20.  
  21. public class LoginFrame extends JFrame
  22. {
  23.  
  24.         private JPanel contentPane;
  25.         public JPasswordField pwd密码;
  26.         private JLabel lblQQ2013;
  27.         public JLabel lbl头像;
  28.         public JCheckBox checkBox记住密码;
  29.         public JCheckBox checkBox自动登录;
  30.         public JLabel lbl登录;
  31.         public JTextField textField用户名;
  32.         public JLabel lbl注册账号;
  33.         public JLabel lbl忘记密码;
  34.         public JLabel lbl最小化;
  35.         public JLabel lbl退出;
  36.         public JLabel lbl多账号;
  37.         public JLabel lbl设置;
  38.         public JComboBox comboBox状态;
  39.         /**
  40.          * Launch the application.
  41.          */
  42.         public static void main(String[] args)
  43.         {
  44.                 EventQueue.invokeLater(new Runnable()
  45.                 {
  46.                         public void run()
  47.                         {
  48.                                 try
  49.                                 {
  50.                                         LoginFrame frame = new LoginFrame();
  51.                                         //AWTUtilities.setWindowOpaque(frame, false);//设置窗体完全透明
  52.                                         frame.setVisible(true);
  53.                                 }
  54.                                 catch (Exception e)
  55.                                 {
  56.                                         e.printStackTrace();
  57.                                 }
  58.                         }
  59.                 });
  60.         }
  61.  
  62.         /**
  63.          * Create the frame.
  64.          */
  65.         public LoginFrame()
  66.         {
  67.                 setTitle("QQ2013");
  68.                 setIconImage(Toolkit.getDefaultToolkit().getImage(LoginFrame.class.getResource("/client/img/QQ_64.png")));
  69.                 setUndecorated(true);//设置窗体没有边框
  70.                 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  71.                 setBounds(100, 100, 354, 272);
  72.                
  73.                 contentPane = new MyPanel("../img/QQ2011_Login.png");
  74.                 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  75.                 setContentPane(contentPane);
  76.                 contentPane.setLayout(null);
  77.                
  78.                 pwd密码 = new JPasswordField();
  79.                 pwd密码.setText("123");
  80.                 pwd密码.setEchoChar('●');
  81.                 pwd密码.setBounds(104, 163, 154, 26);
  82.                 contentPane.add(pwd密码);
  83.                
  84.                 lblQQ2013 = new JLabel("QQ2013");
  85.                 lblQQ2013.setForeground(new Color(0, 0, 51));
  86.                 lblQQ2013.setFont(new Font("宋体", Font.BOLD, 16));
  87.                 lblQQ2013.setBounds(14, 6, 55, 18);
  88.                 contentPane.add(lblQQ2013);
  89.                
  90.                 lbl头像 = new JLabel("");
  91.                 lbl头像.setIcon(new ImageIcon(LoginFrame.class.getResource("/client/img/headImage/head_boy_01_64.jpg")));
  92.                 lbl头像.setBounds(18, 127, 64, 64);
  93.                 contentPane.add(lbl头像);
  94.                
  95.                 checkBox记住密码 = new JCheckBox("\u8BB0\u4F4F\u5BC6\u7801");
  96.                 checkBox记住密码.setBounds(156, 198, 76, 18);
  97.                 contentPane.add(checkBox记住密码);
  98.                
  99.                 checkBox自动登录 = new JCheckBox("\u81EA\u52A8\u767B\u5F55");
  100.                 checkBox自动登录.setBounds(237, 198, 76, 18);
  101.                 contentPane.add(checkBox自动登录);
  102.                
  103.                 lbl登录 = new JLabel("");
  104.                 lbl登录.setIcon(new ImageIcon(LoginFrame.class.getResource("/client/img/button/button_login_1.png")));
  105.                 lbl登录.setBounds(262, 237, 69, 22);
  106.                 contentPane.add(lbl登录);
  107.                
  108.                 textField用户名 = new JTextField();
  109.                 textField用户名.setText("\u9A6C\u5316\u817E");
  110.                 textField用户名.setBounds(104, 128, 154, 26);
  111.                 contentPane.add(textField用户名);
  112.                 textField用户名.setColumns(10);
  113.                
  114.                 lbl注册账号 = new JLabel("\u6CE8\u518C\u8D26\u53F7");
  115.                 lbl注册账号.setFont(new Font("SansSerif", Font.PLAIN, 13));
  116.                 lbl注册账号.setForeground(new Color(0, 51, 255));
  117.                 lbl注册账号.setBounds(288, 132, 55, 18);
  118.                 contentPane.add(lbl注册账号);
  119.                
  120.                 lbl忘记密码 = new JLabel("\u5FD8\u8BB0\u5BC6\u7801");
  121.                 lbl忘记密码.setFont(new Font("SansSerif", Font.PLAIN, 13));
  122.                 lbl忘记密码.setForeground(new Color(0, 51, 255));
  123.                 lbl忘记密码.setBounds(288, 167, 55, 18);
  124.                 contentPane.add(lbl忘记密码);
  125.                
  126.                 lbl最小化 = new JLabel("");
  127.                 lbl最小化.setIcon(new ImageIcon(LoginFrame.class.getResource("/client/img/button/login_minsize_1.png")));
  128.                 lbl最小化.setBounds(284, 0, 29, 19);
  129.                 contentPane.add(lbl最小化);
  130.                
  131.                 lbl退出 = new JLabel("");
  132.                 lbl退出.setIcon(new ImageIcon(LoginFrame.class.getResource("/client/img/button/login_exit_1.png")));
  133.                 lbl退出.setBounds(312, -1, 37, 20);
  134.                 contentPane.add(lbl退出);
  135.                
  136.                 lbl多账号 = new JLabel("");
  137.                 lbl多账号.setIcon(new ImageIcon(LoginFrame.class.getResource("/client/img/button/login_duozhanghao_1.png")));
  138.                 lbl多账号.setBounds(14, 237, 69, 21);
  139.                 contentPane.add(lbl多账号);
  140.                
  141.                 lbl设置 = new JLabel("");
  142.                 lbl设置.setIcon(new ImageIcon(LoginFrame.class.getResource("/client/img/button/login_setting_1.png")));
  143.                 lbl设置.setBounds(93, 237, 69, 21);
  144.                 contentPane.add(lbl设置);
  145.                
  146.                 comboBox状态 = new JComboBox();
  147.                 comboBox状态.setBounds(104, 195, 40, 24);
  148.                 contentPane.add(comboBox状态);
  149.         }
  150. }
  151.  

回复 "QQ"

这儿你可以回复上面这条便签

captcha