您好,登錄后才能下訂單哦!
本篇內(nèi)容主要講解“怎么用Java Swing實(shí)現(xiàn)QQ登錄頁(yè)面”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“怎么用Java Swing實(shí)現(xiàn)QQ登錄頁(yè)面”吧!
代碼如下:
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號(hào)碼", jp4); jta.addTab("手機(jī)號(hào)碼", jp5); jta.addTab("郵箱號(hào)碼", jp6); JLabel jla1=new JLabel("QQ號(hào)碼"); JLabel jla2=new JLabel("QQ密碼"); JLabel jla3=new JLabel("忘記密碼"); jla3.setFont(new Font("宋體",Font.BOLD,16)); jla3.setForeground(Color.BLUE); JLabel jla4=new JLabel("申請(qǐng)密碼保護(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(); } }
運(yùn)行結(jié)果:
到此,相信大家對(duì)“怎么用Java Swing實(shí)現(xiàn)QQ登錄頁(yè)面”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢(xún),關(guān)注我們,繼續(xù)學(xué)習(xí)!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。