最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊

qq

2023-06-09 15:16 作者:福樂哦  | 我要投稿

import javax.swing.JFrame; import java.awt.*; import java.awt.Color; import javax.swing.*; public class QQ extends JFrame{ JLabel L1,L2,L3,L4; JTextField input1; JPasswordField input2; JCheckBox fxk1,fxk2; JButton btn1; JPanel mb1,mb2,mb3,mb4,mb5,mb_c; public static void main(String[] args) { QQ a=new QQ(); } public QQ() { L1=new JLabel("QQ號(hào)碼",JLabel.CENTER); L1.setFont(new Font("微軟雅黑",Font.PLAIN,16)); L1.setForeground(new Color(0,0,0)); //設(shè)置字體顏色 L2=new JLabel("密碼",JLabel.CENTER); L2.setFont(new Font("微軟雅黑",Font.PLAIN,16)); L2.setForeground(new Color(0,0,0)); L3=new JLabel("找回密碼"); L3.setFont(new Font("微軟雅黑",Font.PLAIN,14)); L3.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠標(biāo)移動(dòng)到L3上變?yōu)槭种? ImageIcon img1=new ImageIcon("image/label1.jpg"); img1.setImage(img1.getImage().getScaledInstance(550, 150,Image.SCALE_DEFAULT));//設(shè)置圖片大小 L4=new JLabel(img1); input1=new JTextField(16); input2=new JPasswordField(16); fxk1=new JCheckBox("自動(dòng)登錄"); fxk1.setFont(new Font("微軟雅黑",Font.PLAIN,14)); fxk2=new JCheckBox("記住密碼"); fxk2.setFont(new Font("微軟雅黑",Font.PLAIN,14)); btn1=new JButton(new ImageIcon("image/login.jpg")); mb1=new JPanel(); mb2=new JPanel(); mb3=new JPanel(); mb4=new JPanel(); mb5=new JPanel(); mb_c=new JPanel(); mb1.add(L4); mb_c.setLayout(new GridLayout(3,1)); mb2.add(L1); mb2.add(input1); mb3.add(L2); mb3.add(input2); mb4.add(fxk1); mb4.add(fxk2); mb4.add(L3); mb_c.add(mb2);mb_c.add(mb3);mb_c.add(mb4); mb5.add(btn1); this.setLayout(new BorderLayout()); this.add(mb1,BorderLayout.NORTH); this.add(mb_c,BorderLayout.CENTER); this.add(mb5,BorderLayout.SOUTH); this.setIconImage((new ImageIcon("image/QQ.png")).getImage()); this.setTitle("QQ"); this.setSize(550,430); this.setLocation(1000, 500); this.setResizable(false); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); } } import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class LoginFrame extends JFrame implements ActionListener { ??private JLabel labelAccount, labelPassword; ??private JTextField textFieldAccount; ??private JPasswordField passwordField; ??private JButton buttonLogin; ??public LoginFrame() { ????setTitle("QQ Login"); ????setSize(300, 150); ????setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ????setLocationRelativeTo(null); ????// 創(chuàng)建組件 ????labelAccount = new JLabel("Account:"); ????labelPassword = new JLabel("Password:"); ????textFieldAccount = new JTextField(); ????passwordField = new JPasswordField(); ????buttonLogin = new JButton("Login"); ????// 設(shè)置布局 ????setLayout(new GridLayout(3, 2)); ????// 添加組件 ????add(labelAccount); ????add(textFieldAccount); ????add(labelPassword); ????add(passwordField); ????add(new JPanel()); ????add(buttonLogin); ????// 添加事件監(jiān)聽器 ????buttonLogin.addActionListener(this); ????// 顯示窗口 ????setVisible(true); ??} ??@Override ??public void actionPerformed(ActionEvent e) { ????if (e.getSource() == buttonLogin) { ??????// 登錄驗(yàn)證代碼 ??????String account = textFieldAccount.getText(); ??????String password = new String(passwordField.getPassword()); ??????if (account.equals("admin") && password.equals("123456")) { ????????JOptionPane.showMessageDialog(null, "Login success!"); ????????dispose(); // 關(guān)閉當(dāng)前窗口 ????????new FriendListFrame(); // 打開好友列表窗口 ??????} else { ????????JOptionPane.showMessageDialog(null, "Account or password is incorrect!"); ??????} ????} ??} ??public static void main(String[] args) { ????new LoginFrame(); ??} } import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class FriendListFrame extends JFrame implements ActionListener { ??private JList listFriends; ??private JButton buttonAdd, buttonDelete; ??public FriendListFrame() { ????setTitle("Friend List"); ????setSize(300, 200); ????setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ????setLocationRelativeTo(null); ????// 創(chuàng)建組件 ????listFriends = new JList<>(new String[]{"John", "Tom", "Lucy", "Jane"}); ????buttonAdd = new JButton("Add"); ????buttonDelete = new JButton("Delete"); ????// 設(shè)置布局 ????setLayout(new BorderLayout()); ????// 添加組件 ????add(new JScrollPane(listFriends), BorderLayout.CENTER); ????JPanel panelButtons = new JPanel(); ????panelButtons.add(buttonAdd); ????panelButtons.add(buttonDelete); ????add(panelButtons, BorderLayout.SOUTH); ????// 添加事件監(jiān)聽器 ????buttonAdd.addActionListener(this); ????buttonDelete.addActionListener(this); ????// 顯示窗口 ????setVisible(true); ??} ??@Override ??public void actionPerformed(ActionEvent e) { ????if (e.getSource() == buttonAdd) { ??????String name = JOptionPane.showInputDialog("Input friend name:"); ??????if (name != null && !name.trim().isEmpty()) { ????????DefaultListModel model = (DefaultListModel) listFriends.getModel(); ????????model.addElement(name); ??????} ????} else if (e.getSource() == buttonDelete) { ??????int[] indices = listFriends.getSelectedIndices(); ??????if (indices.length > 0) { ????????DefaultListModel model = (DefaultListModel) listFriends.getModel(); ????????for (int i = indices.length - 1; i >= 0; i--) { ??????????model.remove(indices[i]); ????????} ??????} ????} ??} ??public static void main(String[] args) { ????new FriendListFrame(); ??} }

qq的評(píng)論 (共 條)

分享到微博請遵守國家法律
齐齐哈尔市| 平顶山市| 乐清市| 泽普县| 白河县| 竹溪县| 科技| 克什克腾旗| 达孜县| 中山市| 皋兰县| 台北县| 黄平县| 布拖县| 措勤县| 乐平市| 汾阳市| 慈溪市| 泸西县| 莆田市| 吉隆县| 临安市| 合川市| 安国市| 樟树市| 大化| 肇东市| 织金县| 屏东县| 鹤岗市| 南川市| 镇平县| 修文县| 青河县| 定州市| 逊克县| 探索| 朝阳区| 晋中市| 克什克腾旗| 阿图什市|