国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

模擬QQ登錄-課后程序(JAVA基礎(chǔ)案例教程-黑馬程序員編著-第十一章-課后作業(yè))

這篇具有很好參考價(jià)值的文章主要介紹了模擬QQ登錄-課后程序(JAVA基礎(chǔ)案例教程-黑馬程序員編著-第十一章-課后作業(yè))。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

【案例11-3】 模擬QQ登錄

【案例介紹】

1.案例描述

QQ是現(xiàn)實(shí)生活中常用的聊天工具,QQ登錄界面看似小巧、簡(jiǎn)單,但其中涉及的內(nèi)容卻很多,對(duì)于初學(xué)者練習(xí)Java Swing工具的使用非常合適。本案例要求使用所學(xué)的Java Swing知識(shí),模擬實(shí)現(xiàn)一個(gè)QQ登錄界面。

2.運(yùn)行結(jié)果

模擬QQ登錄-課后程序(JAVA基礎(chǔ)案例教程-黑馬程序員編著-第十一章-課后作業(yè))

?

運(yùn)行結(jié)果

【案例分析】

(1)首先,需要定義一些成員變量,如最小化、關(guān)閉、賬號(hào)、密碼、頭像等,方便響應(yīng)的邏輯實(shí)現(xiàn)。

(2)由于需要對(duì)賬號(hào)、密碼、頭像等進(jìn)行布局,故需要先對(duì)這些對(duì)象進(jìn)行實(shí)例化。

(3)在對(duì)需要用到的文本框、圖片等對(duì)象進(jìn)行實(shí)例化過(guò)后,可以使用對(duì)象.setBounds()設(shè)置文本框、圖片等組件的位置。

(4)接下來(lái),對(duì)最小化、關(guān)閉、賬號(hào)、密碼、頭像等添加監(jiān)聽事件。同時(shí),對(duì)窗體也添加窗體拖動(dòng)監(jiān)聽事件。

(5)最后,為最小化、關(guān)閉等編寫點(diǎn)擊時(shí)的執(zhí)行邏輯。為賬號(hào)、密碼等設(shè)置點(diǎn)擊、懸停等執(zhí)行邏輯。

【案例實(shí)現(xiàn)】

Login.java

  1. package chapter1103;
  2. import java.awt.Color;
  3. ????import java.awt.Cursor;
  4. ????import java.awt.Font;
  5. ????import java.awt.Point;
  6. ????import java.awt.Toolkit;
  7. ????import java.awt.event.FocusEvent;
  8. ????import java.awt.event.FocusListener;
  9. ????import java.awt.event.MouseEvent;
  10. ????import java.awt.event.MouseListener;
  11. import java.awt.event.MouseMotionListener;
  12. import javax.swing.ImageIcon;
  13. import javax.swing.JFrame;
  14. import javax.swing.JLabel;
  15. import javax.swing.JOptionPane;
  16. import javax.swing.JPanel;
  17. import javax.swing.JPasswordField;
  18. import javax.swing.JTextField;
  19. public class Login extends JFrame implements MouseListener {
  20. ??? JLabel bacgrangd, jan,bi,QQ,qq,tu;//gif,最小化,關(guān)閉,logo,QQ,頭像
  21. ??? JLabel an1, an2, lie1, lie2;// 暗色塊|
  22. ??? JTextField user;// 賬號(hào)
  23. ??? JPasswordField pass;// 密碼
  24. ??? JPanel bgcolor;//
  25. ??? JLabel su1, mi1, ku1, ku2, gou1, gou2;// 縮略圖
  26. ??? JLabel text1, text2, text3, text4, text5;//自動(dòng)登錄,記住密碼,找回
  27. //密碼,注冊(cè)賬號(hào),登錄
  28. ??? static Point origin = new Point();// 變量,用于可拖動(dòng)窗體
  29. ??? int a = 0, b = 0, c = 0, d = 0;// 控制線
  30. ??? int f = 0, g = 0, h = 0, j = 0;// 控制√
  31. ??? JLabel submit, ma;// 背景
  32. ??? public Login() {
  33. ??????? //實(shí)例化
  34. ??????? bacgrangd = new JLabel(new ImageIcon("images/1.gif"));
  35. ??????? jan = new JLabel(new ImageIcon("images/最小化.png"));
  36. ??????? bi = new JLabel(new ImageIcon("images/關(guān)閉.png"));
  37. ??????? QQ = new JLabel(new ImageIcon("imagesqq.png"));
  38. ??????? qq = new JLabel("QQ");
  39. ??????? an1 = new JLabel();
  40. ??????? an2 = new JLabel();// 暗調(diào)
  41. ??????? tu = new JLabel(new ImageIcon("images/頭像.png"));
  42. ??????? user = new JTextField();
  43. ??????? pass = new JPasswordField();
  44. ??????? su1 = new JLabel(new ImageIcon("images/qq (1).png"));
  45. ??????? mi1 = new JLabel(new ImageIcon("images/密碼.png"));
  46. ??????? lie1 = new JLabel(new ImageIcon("images/直線2.png"));
  47. ??????? lie2 = new JLabel(new ImageIcon("images/直線2.png"));
  48. ??????? bgcolor = new JPanel();
  49. ??????? ku1 = new JLabel(new ImageIcon("images/框框.png"));
  50. ??????? ku2 = new JLabel(new ImageIcon("images/框框.png"));
  51. ??????? gou1 = new JLabel(new ImageIcon("images/對(duì)勾.png"));
  52. ??????? gou2 = new JLabel(new ImageIcon("images/對(duì)勾.png"));
  53. ??????? text1 = new JLabel("自動(dòng)登錄");
  54. ??????? text2 = new JLabel("記住密碼");
  55. ??????? text3 = new JLabel("找回密碼");
  56. ??????? text4 = new JLabel("注冊(cè)賬號(hào)");
  57. ??????? text5 = new JLabel("登錄");
  58. ??????? submit = new JLabel();
  59. ??????? ma = new JLabel(new ImageIcon("images/二維碼.png"));
  60. ??????? //位置
  61. ??????? bacgrangd.setBounds(-35, -123, 500, 250);
  62. ??????? jan.setBounds(364, 2, 32, 32);
  63. ??????? bi.setBounds(396, 3, 32, 32);
  64. ??????? QQ.setBounds(10, 10, 32, 32);
  65. ??????? qq.setBounds(50, 5, 45, 45);
  66. ??????? an1.setBounds(361, 0, 35, 35);
  67. ??????? an2.setBounds(395, 0, 35, 35);
  68. ??????? tu.setBounds(170, 80, 90, 85);
  69. ??????? user.setBounds(130, 160, 180, 40);
  70. ??????? pass.setBounds(130, 200, 180, 40);
  71. ??????? su1.setBounds(100, 170, 20, 20);
  72. ??????? mi1.setBounds(100, 210, 20, 20);
  73. ??????? lie1.setBounds(100, 190, 240, 10);
  74. ??????? lie2.setBounds(100, 230, 240, 10);
  75. ??????? bgcolor.setBounds(0, 125, 500, 300);
  76. ??????? ku1.setBounds(100, 250, 20, 20);
  77. ??????? ku2.setBounds(190, 250, 20, 20);
  78. ??????? gou1.setBounds(106, 255, 10, 10);
  79. ??????? gou2.setBounds(196, 255, 10, 10);
  80. ??????? text1.setBounds(125, 250, 80, 20);
  81. ??????? text2.setBounds(215, 250, 80, 20);
  82. ??????? text3.setBounds(288, 250, 80, 20);
  83. ??????? text4.setBounds(15, 300, 80, 20);
  84. ??????? text5.setBounds(206, 285, 80, 20);
  85. ??????? submit.setBounds(100, 280, 242, 35);
  86. ??????? ma.setBounds(385, 290, 30, 30);
  87. ??????? //屬性
  88. ??????? qq.setFont(new Font("微軟雅黑", 1, 25));
  89. ??????? qq.setForeground(Color.white);
  90. ??????? an1.setBackground(new Color(0, 0, 0, 0.3f));
  91. ??????? an2.setBackground(new Color(0, 0, 0, 0.3f));
  92. ??????? bgcolor.setBackground(new Color(255, 255, 255));
  93. ??????? user.setForeground(Color.gray);
  94. ??????? user.setText("QQ號(hào)碼/手機(jī)/郵箱");
  95. ??????? user.setOpaque(false);// 透明背景
  96. ??????? user.setBorder(null);// 去掉邊框
  97. ?????????// 框內(nèi)文字樣式
  98. ??????? user.setFont(new Font("微軟雅黑", Font.PLAIN, 16));
  99. ?????????// 框內(nèi)文字樣式
  100. ??????? pass.setFont(new Font("微軟雅黑", Font.PLAIN, 16));
  101. ??????? pass.setBorder(null);// 去掉邊框
  102. ??????? pass.setOpaque(false);// 透明背景
  103. ??????? pass.setForeground(Color.gray);
  104. ??????? pass.setText("密碼");
  105. ??????? pass.setEchoChar((char) 0);// 讓密碼顯示出來(lái)
  106. ??????? text1.setFont(new Font("微軟雅黑", 0, 12));
  107. ??????? text2.setFont(new Font("微軟雅黑", 0, 12));
  108. ??????? text3.setFont(new Font("微軟雅黑", 0, 12));
  109. ??????? text4.setFont(new Font("微軟雅黑", 0, 12));
  110. ??????? text5.setFont(new Font("微軟雅黑", 0, 15));
  111. ??????? text1.setForeground(new Color(170, 170, 170));
  112. ??????? text2.setForeground(new Color(170, 170, 170));
  113. ??????? text3.setForeground(new Color(170, 170, 170));
  114. ??????? text4.setForeground(new Color(170, 170, 170));
  115. ??????? text5.setForeground(Color.white);
  116. ??????? gou1.setVisible(false);
  117. ??????? gou2.setVisible(false);
  118. ??????? submit.setBackground(new Color(5, 186, 251));
  119. ??????? submit.setOpaque(true);
  120. ??? ?text3.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  121. ??? ?text4.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  122. ??????? //事件區(qū)域
  123. ??????? jan.addMouseListener(this);
  124. ??????? bi.addMouseListener(this);
  125. ??????? user.addMouseListener(this);
  126. ??????? pass.addMouseListener(this);
  127. ??????? text1.addMouseListener(this);
  128. ??????? text2.addMouseListener(this);
  129. ??????? text3.addMouseListener(this);
  130. ??????? text4.addMouseListener(this);
  131. ??????? ku1.addMouseListener(this);
  132. ??????? ku2.addMouseListener(this);
  133. ??????? submit.addMouseListener(this);
  134. ??????? ma.addMouseListener(this);
  135. ??????? this.addMouseListener(this);
  136. ?????????// 窗體拖動(dòng)事件
  137. ?this.addMouseMotionListener(new MouseMotionListener() {
  138. ?????????? public void mouseMoved(MouseEvent e) {
  139. ??????? }
  140. ??? public void mouseDragged(MouseEvent e) {
  141. ??? ???Point p = getLocation();
  142. ????????setLocation(p.x + e.getX()-origin.x, p.y + e.getY()-origin.y);
  143. ??? }
  144. });
  145. user.addFocusListener(new FocusListener() {
  146. ?????public void focusLost(FocusEvent e) {// 失去焦點(diǎn)
  147. ??????? ?su1.setIcon(new javax.swing.ImageIcon("images/qq (1).png"));
  148. ??????? ?lie1.setIcon(new javax.swing.ImageIcon("images/直線2.png"));
  149. ?????????? ??c = 0;
  150. ??????????????// 判斷是否為空(為了設(shè)置默認(rèn)提示語(yǔ))
  151. ??? ?????????if (user.getText().isEmpty()) {
  152. ?????????????????? user.setForeground(Color.gray);
  153. ?????????????????? user.setText("QQ號(hào)碼/手機(jī)/郵箱");
  154. ?????????????? }
  155. ?????????? }
  156. ????????// 得到焦點(diǎn)
  157. ??? ???public void focusGained(FocusEvent e) {
  158. ??????? ?user.setForeground(Color.black);
  159. ??????? ?lie1.setIcon(new javax.swing.ImageIcon("images/直線3.png"));
  160. ?????????????? a = 1;
  161. ?????????????? c = 1;
  162. ?????????????? b = 0;
  163. ??????? ??su1.setIcon(new javax.swing.ImageIcon("images/qq(2).png"));
  164. ?????????????? if (user.getText().equals("QQ號(hào)碼/手機(jī)/郵箱")) {
  165. ?????????????????? user.setText("");
  166. ?????????????? } else {
  167. ?????????????????? user.setText(user.getText());
  168. ?????????????????? user.selectAll();
  169. ?????????????? }
  170. ?????????? }
  171. ??????? });
  172. ??????? pass.addFocusListener(new FocusListener() {
  173. ????????????// 失去焦點(diǎn)
  174. ??????? ???public void focusLost(FocusEvent e) {
  175. ????????????// 失去焦點(diǎn)換圖片
  176. ??????? ???lie2.setIcon(new javax.swing.ImageIcon("images/2.png"));
  177. ??????? ???mi1.setIcon(new javax.swing.ImageIcon("images/密碼.png"));
  178. ?????????????? d = 0;
  179. ?????????????? if (pass.getText().isEmpty()) {
  180. ?????????????????? pass.setForeground(Color.gray);
  181. ?????????????????? pass.setText("密碼");
  182. ?????????????????? pass.setEchoChar((char) 0);// 讓密碼顯示出來(lái)
  183. ?????????????? }
  184. ?????????? }
  185. ??????? public void focusGained(FocusEvent e) {// 得到焦點(diǎn)
  186. ?????????????? mi1.setIcon(new javax.swing.ImageIcon("images/密碼"+
  187. ??????????????????" (1).png"));
  188. ?????????????? lie2.setIcon(new javax.swing.ImageIcon("images/直線"+
  189. ??????????????????"3.png"));
  190. ?????????????? b = 1;
  191. ?????????????? a = 0;
  192. ?????????????? d = 1;
  193. ?????????????? pass.setForeground(Color.black);
  194. ?????????????? pass.setEchoChar('*');// 讓用戶輸入看不見
  195. ?????????????? if (pass.getText().equals("密碼")) {
  196. ?????????????????? pass.setText("");
  197. ?????????????? } else {
  198. ?????????????????? pass.setText(pass.getText());
  199. ?????????????? }
  200. ?????????? }
  201. ??????? });
  202. ??????? this.setLayout(null);// 布局
  203. ??????? this.add(jan);
  204. ??????? this.add(bi);
  205. ??????? this.add(qq);
  206. ??????? this.add(QQ);
  207. ??????? this.add(an1);
  208. ??????? this.add(an2);
  209. ??????? this.add(tu);
  210. ??????? this.add(lie1);
  211. ??????? this.add(lie2);
  212. ??????? this.add(user);
  213. ??????? this.add(pass);
  214. ??????? this.add(su1);
  215. ??????? this.add(mi1);
  216. ??????? this.add(gou1);
  217. ??????? this.add(gou2);
  218. ??????? this.add(ku1);
  219. ??????? this.add(ku2);
  220. ??????? this.add(text1);
  221. ??????? this.add(text2);
  222. ??????? this.add(text3);
  223. ??????? this.add(text4);
  224. ??????? this.add(text5);
  225. ??????? this.add(submit);
  226. ??????? this.add(ma);
  227. ??????? this.add(bgcolor);
  228. ??????? this.add(bacgrangd);
  229. ??????? this.setSize(430, 330);
  230. this.setIconImage(Toolkit.getDefaultToolkit().createImage("images"+
  231. ????"/透明照片.png"));// 窗體圖標(biāo)
  232. ??????? this.setLocationRelativeTo(null);// 保持居中
  233. ??????? this.setUndecorated(true);// 去頂部
  234. ??????? this.setFocusable(true);// 面板首先獲得焦點(diǎn)
  235. ??????? this.setBackground(new Color(255, 255, 255));// 背景顏色
  236. ??? ??? this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
  237. ??????? this.setAlwaysOnTop(true);// 最頂層
  238. ??????? this.setVisible(true);// 顯示
  239. ??? }
  240. ??? public static void main(String[] args) {
  241. ??????? new Login();
  242. ??? }
  243. ????// 點(diǎn)擊不恢復(fù)
  244. ??? public void mouseClicked(MouseEvent e) {
  245. ??? }
  246. ????// 點(diǎn)擊后
  247. ??? public void mousePressed(MouseEvent e) {
  248. ??????? if (e.getSource() == jan) {
  249. ?????????? setExtendedState(JFrame.ICONIFIED);
  250. ??????? } else if (e.getSource() == this) {
  251. ?????????? origin.x = e.getX();
  252. ?????????? origin.y = e.getY();
  253. ??????? } else if (e.getSource() == bi) {
  254. ?????????? System.exit(0);
  255. ??????? } else if (e.getSource() == ku1 || e.getSource() == text1) {
  256. ?????????? if (f == 0) {
  257. ?????????????? gou1.setVisible(true);
  258. ?????????????? g = 1;
  259. ?????????????? f = 1;
  260. ?????????? } else if (g == 1) {
  261. ?????????????? gou1.setVisible(false);
  262. ?????????????? f = 0;
  263. ?????????????? g = 0;
  264. ?????????? }
  265. ??????? } else if (e.getSource() == ku2 || e.getSource() == text2) {
  266. ?????????? if (h == 0) {
  267. ?????????????? gou2.setVisible(true);
  268. ?????????????? j = 1;
  269. ?????????????? h = 1;
  270. ?????????? } else if (j == 1) {
  271. ?????????????? gou2.setVisible(false);
  272. ?????????????? h = 0;
  273. ?????????????? j = 0;
  274. ??? ??????? }
  275. ??? ??} else if (e.getSource() == submit || e.getSource() == text5) {
  276. ?????????? text5.setFont(new Font("微軟雅黑", 0, 14));
  277. ?????????? dispose();
  278. ?????????? String users = user.getText();
  279. ?????????? String password = pass.getText();
  280. ?????????? if (users.equals("itcast") && password.equals("123")) {
  281. ??????? ???//new Table();//打開新的主界面如果要關(guān)閉登錄界面可以寫dispose();
  282. ?????????? } else {
  283. ?????????? JOptionPane.showMessageDialog(null, "用戶名:itcast,密"+
  284. ???????????????????"碼:123,您并未設(shè)置打開界面!");
  285. ?????????????? new Login();
  286. ?????????? }
  287. ??????? }
  288. ??? }
  289. ?????// 點(diǎn)擊時(shí)
  290. ??? public void mouseReleased(MouseEvent e) {
  291. ??????? if (e.getSource() == submit || e.getSource() == text5) {
  292. ?????????? text5.setFont(new Font("微軟雅黑", 0, 15));
  293. ??????? }
  294. ??? }
  295. ?????// 懸停
  296. ??? public void mouseEntered(MouseEvent e) {
  297. ??????? if (e.getSource() == jan) {
  298. ?????????? an1.setOpaque(true);
  299. ??????? } else if (e.getSource() == bi) {
  300. ?????????? an2.setOpaque(true);
  301. ??????? } else if (e.getSource() == user) {
  302. ?????????? if (a == 0 && c == 0) {
  303. ??????? ?lie1.setIcon(new javax.swing.ImageIcon("images/直線4.png"));
  304. ?????????? }
  305. ??????? } else if (e.getSource() == pass) {
  306. ?????????? if (b == 0 && d == 0) {
  307. ??????? ?lie2.setIcon(new javax.swing.ImageIcon("images/直線4.png"));
  308. ?????????? }
  309. ??????? } else if (e.getSource() == text3) {
  310. ?????????? text3.setForeground(Color.GRAY);
  311. ??????? } else if (e.getSource() == text4) {
  312. ?????????? text4.setForeground(Color.GRAY);
  313. ??????? } else if (e.getSource() == ma) {
  314. ??????? ??ma.setIcon(new javax.swing.ImageIcon("images/二維碼2.png"));
  315. ??????? }
  316. ??? }
  317. ??? public void mouseExited(MouseEvent e) {// 懸停后
  318. ??????? if (e.getSource() == jan) {
  319. ?????????? an1.setOpaque(false);
  320. ??????? } else if (e.getSource() == bi) {
  321. ?????????? an2.setOpaque(false);
  322. ??????? } else if (e.getSource() == user) {
  323. ?????????? if (a == 0) {
  324. ??????? ?lie1.setIcon(new javax.swing.ImageIcon("images/直線2.png"));
  325. ?????????? }
  326. ??????? } else if (e.getSource() == pass) {
  327. ?????????? if (b == 0) {
  328. ??????? ?lie2.setIcon(new javax.swing.ImageIcon("images/直線2.png"));
  329. ?????????? }
  330. ??????? } else if (e.getSource() == text3) {
  331. ?????????? text3.setForeground(new Color(170, 170, 170));
  332. ??????? } else if (e.getSource() == text4) {
  333. ?????????? text4.setForeground(new Color(170, 170, 170));
  334. ??????? } else if (e.getSource() == ma) {
  335. ?????????? ma.setIcon(new javax.swing.ImageIcon("images/二碼.png"));
  336. ??????? }
  337. ??? }
  338. }

上述代碼中,第19-30行代碼,定義了一些成員變量,方便響應(yīng)的邏輯實(shí)現(xiàn)。第33-58行代碼,對(duì)一些圖片對(duì)象進(jìn)行實(shí)例化。第60-85行,設(shè)置圖片、文本框等的位置。第87-120行,設(shè)置各個(gè)文本框,文字等的樣式。第122-134行,為各個(gè)文本框、按鈕等設(shè)置監(jiān)聽事件。第136-143行,為窗體拖動(dòng)事件設(shè)置窗體監(jiān)聽。第144-170,為賬號(hào)文本框設(shè)置鼠標(biāo)聚焦事件。第171-200,為密碼文本框設(shè)置鼠標(biāo)聚焦事件。第201-227行,將各個(gè)按鈕,圖片文本框?qū)ο蠓湃肴萜鲀?nèi)。第228-238,對(duì)界面進(jìn)行布局。mouseClicked()方法中編寫了按鈕,文本框,文字等點(diǎn)擊不回復(fù)的邏輯。mousePressed()方法中編寫了按鈕,文本框,文字等點(diǎn)擊后的邏輯。mouseReleased()方法中編寫了按鈕,文本框,文字等點(diǎn)擊時(shí)的邏輯。mouseEntered()方法中編寫了按鈕,文本框,文字等懸停時(shí)的邏輯。mouseExited()方法中編寫了按鈕,文本框,文字等懸停后的邏輯。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-479671.html

到了這里,關(guān)于模擬QQ登錄-課后程序(JAVA基礎(chǔ)案例教程-黑馬程序員編著-第十一章-課后作業(yè))的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 圖書管理系統(tǒng)登錄頁(yè)面--課后程序(Python程序開發(fā)案例教程-黑馬程序員編著-第12章-課后作業(yè))

    圖書管理系統(tǒng)登錄頁(yè)面--課后程序(Python程序開發(fā)案例教程-黑馬程序員編著-第12章-課后作業(yè))

    登錄與注冊(cè)是程序中最基本的模塊。用戶只有登錄成功后,才可以使用應(yīng)用系統(tǒng)中的全部功能。若用戶沒有登錄賬號(hào),可通過(guò)注冊(cè)界面設(shè)置登錄賬號(hào)信息。某圖書管理系統(tǒng)的登錄窗口如圖1所示。 ? 登錄界面 圖1的窗口中包含用戶名、密碼、驗(yàn)證碼、登錄、注冊(cè)、退出。當(dāng)用戶

    2024年02月03日
    瀏覽(86)
  • 黑馬程序員《PHP基礎(chǔ)案例教程》第2版課后練習(xí)—第03章

    答案均參考教材官方發(fā)布的PPT,以下是下載PPT的頁(yè)面 人民郵電出版社教育社區(qū):PHP基礎(chǔ)案例教程(第2版)-圖書-人郵教育社區(qū) 1、定義函數(shù)使用的為(function)。 2、用于對(duì)字符串中的某些字符進(jìn)行替換操作的函數(shù)是(str_replace())。 3、使用(strlen())函數(shù)可以獲取字符

    2024年01月18日
    瀏覽(30)
  • Java模擬QQ登錄界面(GUI)

    Java模擬QQ登錄界面(GUI)

    鏈接: https://pan.baidu.com/s/13JJFyg14CbShs_HzLAoW6w?pwd=pwu3 提取碼: pwu3? 對(duì)每個(gè)文本框進(jìn)行監(jiān)控,鼠標(biāo)定在哪的時(shí)候,下邊框變?yōu)樗{(lán)色 用戶光標(biāo)定到文本框的時(shí)候,要是沒有輸入信息,就把里面的提示文字給清除掉,給用戶一個(gè)好的體驗(yàn) 登錄的時(shí)候?qū)~號(hào)和密碼檢驗(yàn),要是賬號(hào)和密碼都是ad

    2024年02月03日
    瀏覽(23)
  • 刮刮樂(lè)--課后程序(Python程序開發(fā)案例教程-黑馬程序員編著-第4章-課后作業(yè))

    刮刮樂(lè)的玩法多種多樣,彩民只要刮去刮刮樂(lè)上的銀色油墨即可查看是否中獎(jiǎng)。每張刮刮樂(lè)都有多個(gè)兌獎(jiǎng)區(qū),每個(gè)兌獎(jiǎng)區(qū)對(duì)應(yīng)著不同的獲獎(jiǎng)信息,包括“一等獎(jiǎng)”、“二等獎(jiǎng)”、“三等獎(jiǎng)”和“謝謝惠顧”。假設(shè)現(xiàn)在有一張刮刮樂(lè),該卡片上面共有8個(gè)刮獎(jiǎng)區(qū),每個(gè)刮獎(jiǎng)區(qū)對(duì)應(yīng)

    2024年02月06日
    瀏覽(472)
  • 井字棋--課后程序(Python程序開發(fā)案例教程-黑馬程序員編著-第7章-課后作業(yè))

    井字棋--課后程序(Python程序開發(fā)案例教程-黑馬程序員編著-第7章-課后作業(yè))

    井字棋是一種在3 * 3格子上進(jìn)行的連珠游戲,又稱井字游戲。井字棋的游戲有兩名玩家,其中一個(gè)玩家畫圈,另一個(gè)玩家畫叉,輪流在3 * 3格子上畫上自己的符號(hào),最先在橫向、縱向、或斜線方向連成一條線的人為勝利方。如圖1所示為畫圈的一方為勝利者。 ? 圖1 井字棋 本實(shí)

    2024年02月04日
    瀏覽(188)
  • 純JAVA模擬、實(shí)現(xiàn)QQ簡(jiǎn)易聊天互動(dòng)程序

    純JAVA模擬、實(shí)現(xiàn)QQ簡(jiǎn)易聊天互動(dòng)程序

    實(shí)現(xiàn)的功能、步驟: 1、定義JFrame窗體中的組件 2、在構(gòu)造方法中初始化窗體的組件 3、使用網(wǎng)絡(luò)編程完成數(shù)據(jù)的傳輸(TCP,UDP協(xié)議) 4、實(shí)現(xiàn)發(fā)送按鈕的監(jiān)聽點(diǎn)擊事件 5、實(shí)現(xiàn)回車鍵發(fā)送數(shù)據(jù)?? 功能演示: 沒有點(diǎn)發(fā)送,數(shù)據(jù)卻發(fā)送出去了是因?yàn)榘戳嘶剀囨I? ?運(yùn)用到的知識(shí)點(diǎn)

    2024年02月11日
    瀏覽(25)
  • 手機(jī)通訊錄--課后程序(Python程序開發(fā)案例教程-黑馬程序員編著-第5章-課后作業(yè))

    手機(jī)通訊錄--課后程序(Python程序開發(fā)案例教程-黑馬程序員編著-第5章-課后作業(yè))

    通訊錄是記錄了聯(lián)系人姓名和聯(lián)系方式的名錄,手機(jī)通訊錄是最常見的通訊錄之一,人們可以在通訊錄中通過(guò)姓名查看相關(guān)聯(lián)系人的聯(lián)系方式、郵箱、地址等信息,也可以在其中新增聯(lián)系人,或修改、刪除聯(lián)系人信息。下面是一個(gè)常見通訊錄的功能菜單,如圖1所示。 ? 圖1

    2024年02月01日
    瀏覽(89)
  • 銀行管理系統(tǒng)--課后程序(Python程序開發(fā)案例教程-黑馬程序員編著-第7章-課后作業(yè))

    銀行管理系統(tǒng)--課后程序(Python程序開發(fā)案例教程-黑馬程序員編著-第7章-課后作業(yè))

    從早期的錢莊到現(xiàn)如今的銀行,金融行業(yè)在不斷地變革;隨著科技的發(fā)展、計(jì)算機(jī)的普及,計(jì)算機(jī)技術(shù)在金融行業(yè)得到了廣泛的應(yīng)用。銀行管理系統(tǒng)是一個(gè)集開戶、查詢、取款、存款、轉(zhuǎn)賬、鎖定、解鎖、退出等一系列的功能的管理系統(tǒng),該系統(tǒng)中各功能的介紹如下。 開戶功

    2024年02月04日
    瀏覽(95)
  • 逢七拍手游戲--課后程序(Python程序開發(fā)案例教程-黑馬程序員編著-第3章-課后作業(yè))

    逢7拍手游戲的規(guī)則是:從1開始順序數(shù)數(shù),數(shù)到有7或者包含7的倍數(shù)的時(shí)候拍手。本實(shí)例要求編寫程序,模擬實(shí)現(xiàn)逢七拍手游戲,輸出100以內(nèi)需要拍手的數(shù)字。 掌握f(shuō)or循環(huán)與range()函數(shù)的使用 掌握字符串中find()方法的使用 判斷一個(gè)數(shù)字是否與7相關(guān),可分為兩種情況: 1.是否為

    2024年02月06日
    瀏覽(138)
  • 加油優(yōu)惠價(jià)格計(jì)算-課后程序(JavaScript前端開發(fā)案例教程-黑馬程序員編著-第2章-課后作業(yè))

    加油優(yōu)惠價(jià)格計(jì)算-課后程序(JavaScript前端開發(fā)案例教程-黑馬程序員編著-第2章-課后作業(yè))

    一、案例描述 考核知識(shí)點(diǎn) if 、 if…else 、if…else if…else 練習(xí)目標(biāo) 掌握if單分支語(yǔ)句。 掌握if…else雙分支語(yǔ)句 掌握if…else if…else多分支語(yǔ)句 需求分析 加油站,為了鼓勵(lì)車主多加油,實(shí)行多加多優(yōu)惠政策,具體優(yōu)惠如下: 已知92號(hào)汽油,每升6元;如果大于等于20升,那么每

    2024年02月07日
    瀏覽(108)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包