Java?Swing實現(xiàn)QQ登錄頁面
更新時間:2022年02月25日 11:10:32 作者:大菜彩
這篇文章主要為大家詳細(xì)介紹了Java?Swing實現(xiàn)QQ登錄頁面,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了Java Swing 實現(xiàn)QQ登錄頁面,供大家參考,具體內(nèi)容如下
代碼如下:
import java.awt.*;
import javax.swing.*;?
public class Demo121 extends JFrame{
?? ?public Demo121()
?? ?{
?? ??? ?JPanel jp1=new JPanel();
?? ??? ?JPanel jp2=new JPanel();
?? ??? ?JPanel jp3=new JPanel();? ? ? ??
?? ??? ?
?? ??? ?Icon icon1=new ImageIcon(getClass().getResource("/com/res/tou.gif"));
?? ??? ?Icon icon2=new ImageIcon(getClass().getResource("/com/res/clear.gif"));
?? ??? ?Icon icon3=new ImageIcon(getClass().getResource("/com/res/denglu.gif"));
?? ??? ?Icon icon4=new ImageIcon(getClass().getResource("/com/res/quxiao.gif"));
?? ??? ?Icon icon5=new ImageIcon(getClass().getResource("/com/res/xiangdao.gif"));
?? ?
?? ??? ?JButton jb1=new JButton();
?? ??? ?JButton jb2=new JButton();
?? ??? ?JButton jb3=new JButton();
?? ??? ?JButton jb4=new JButton();
?? ??? ?JButton jb5=new JButton();
?? ??? ?jb1.setIcon(icon1);
?? ??? ?jb2.setIcon(icon2);
?? ??? ?jb3.setIcon(icon3);
?? ??? ?jb4.setIcon(icon4);
?? ??? ?jb5.setIcon(icon5);
?? ??? ?
?? ??? ?JTabbedPane jta=new JTabbedPane(JTabbedPane.TOP);
?? ??? ?JPanel jp4=new JPanel();
?? ??? ?JPanel jp5=new JPanel();
?? ??? ?JPanel jp6=new JPanel();
?? ??? ?jta.addTab("QQ號碼", jp4);
?? ??? ?jta.addTab("手機號碼", jp5);
?? ??? ?jta.addTab("郵箱號碼", jp6);? ? ? ??
?? ??? ?
?? ??? ?JLabel jla1=new JLabel("QQ號碼");
?? ??? ?JLabel jla2=new JLabel("QQ密碼");
?? ??? ?JLabel jla3=new JLabel("忘記密碼");
?? ??? ?jla3.setFont(new Font("宋體",Font.BOLD,16));
?? ??? ?jla3.setForeground(Color.BLUE);
?? ??? ?? ??
?? ??? ?JLabel jla4=new JLabel("申請密碼保護(hù)");
?? ??? ?jla4.setForeground(Color.BLUE);
?? ??? ?
?? ??? ?JRadioButton jra1=new JRadioButton("隱身登陸");
?? ??? ?JRadioButton jra2=new JRadioButton("記住密碼");
?? ??? ?JTextField jte=new JTextField(10);
?? ??? ?JPasswordField jpa=new JPasswordField(10);
?? ??? ?jp4.setLayout(new GridLayout(3,3,1,2));
?? ??? ?jp4.add(jla1);
?? ??? ?jp4.add(jte);
?? ??? ?jp4.add(jb2);
?? ??? ?jp4.add(jla2);
?? ??? ?jp4.add(jpa);
?? ??? ?jp4.add(jla3);
?? ??? ?jp4.add(jra1);
?? ??? ?jp4.add(jra2);
?? ??? ?jp4.add(jla4);
?? ??? ?jp1.add(jb1);
?? ??? ?jp2.add(jta);
?? ??? ?jp3.add(jb3);
?? ??? ?jp3.add(jb4);
?? ??? ?jp3.add(jb5);
?? ??? ?
?? ??? ?this.add(jp1,BorderLayout.NORTH);
?? ??? ?this.add(jp2,BorderLayout.CENTER);
?? ??? ?this.add(jp3,BorderLayout.SOUTH);
?? ??? ?
?? ??? ?
?? ??? ?this.setSize(400, 290);
?? ??? ?this.setVisible(true);
?? ??? ?this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
?? ??? ?this.setLocation(450, 120);
?? ??? ?
?? ?}
?? ?
?? ?public static void main(String[] args) {
?? ??? ?Demo121 de=new Demo121();
?? ?}
}運行結(jié)果:

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
eclipse啟動出現(xiàn)“failed to load the jni shared library”問題解決
這篇文章主要介紹了eclipse啟動出現(xiàn)“failed to load the jni shared library”問題解決,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下2019-11-11
Java微信公眾平臺開發(fā)(8) 多媒體消息回復(fù)
這篇文章主要為大家詳細(xì)介紹了Java微信公眾平臺開發(fā)第八步,微信多媒體消息回復(fù),具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-04-04
SpringMVC項目訪問controller時候報404的解決
這篇文章主要介紹了SpringMVC項目訪問controller時候報404的解決方案,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2021-09-09
啟動springboot項目時報錯:無法訪問org.springframework.web.bind.annotatio
這篇文章給大家分享了啟動springboot項目時報錯:?無法訪問org.springframework.web.bind.annotation.GetMapping …具有錯誤的版本 61.0,應(yīng)為52.0?的解決方案,文中通過圖文介紹的非常詳細(xì),需要的朋友可以參考下2023-10-10

