下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
packageB;importjava。awt。Color;importjava.awt。Font;importjava。awt。event。ActionEvent;import。ActionListener;import;import;importjavax.swing。JFrame;importjavax。swing.JLabel;importjavax.swing。JPasswordField;import;publicclassCextendsJFrame{staticCd;JButtonjb1,jb2,jb3;C(){this.setTitle("登岸”);this.setSize(600,400);this.setLocation(600,400);JLabeljl=newJLabel(newImageIcon("g://6.jpg"));增添背景Fontf=newFont("Serif",Font.BOLD,14);設置字體JTextFieldjt=newJTextField();JPasswordFieldjp=newJPasswordField();this。setLayout(null);jb1=newJButton(”登岸");jb1。addActionListener(newMyListener());//增添監(jiān)聽jb1。setBackground(Color.gray);設置背景顏色jb2=newJButton(”注冊”);jb2。setBackground(Color.gray);jt。setBounds(90,150,90,20);jp。setBounds(90,190,90,20);jb1。setBounds(50,250,60,20);jb2。setBounds(120,250,60,20);this。add(jt);this。add(jp);this。add(jb1);this.add(jb2);this。setLayout(null);jl.setBounds(0,0,600,400);設置背景大小this。add(jl}
);class
MyListener
implements
ActionListener
{public
void
actionPerformed(ActionEventarg0){d。dispose(newjiemian
);()
;}}public
static
void
main(String
[]
args){d=newC(
);d.setDefaultCloseOperation(JFrame.
DISPOSE_ON_CLOSE
);d。setVisible
(true
);}}packageB;importjava.awt.FlowLayout;importjava。awt。event。ActionEvent;importjava。awt.event。ActionListener;importjavax.swing。ImageIcon;importjavax.swing。JButton;importjavax。swing.JFrame;import;publicclassjiemianextendsJFrame{JButtonjb1,jb2,jb3,jb4,jb5,jb6;staticjiemiano;jiemian(){this。setVisible(true);this。setTitle(”圖書室管理系統(tǒng)”);this。setSize(600,400);this.setLocation(300,200);JLabeljl=newJLabel(newImageIcon(”g://2。jpg"));//增添背景jb1=newJButton(”圖書采買");jb2=newJButton(”圖書入庫”);jb3=newJButton(”圖書流通”);jb4=newJButton(”讀者管理”);jb5=newJButton("統(tǒng)計查問”);jb6=newJButton(”系統(tǒng)設置");this。add(jb1);this。add(jb2);this。add(jb3);this.add(jb4);this。add(jb5);this.add(jb6);this.setLayout(null);jl.setBounds(0,0,600,400);設置背景大小this.add(jl);this.setLayout(newFlowLayout());jb1.addActionListener(newMyListener1());jb2。addActionListener(newMyListener2( ));jb3.addActionListener(newMyListener3());jb4.addActionListener(newMyListener4());jb5。addActionListener(newMyListener5());jb6.addActionListener(newMyListener6());this。setVisible(true);}classMyListener1implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e。getSource( )==jb1){newjiemian1();o.dispose();}}}classMyListener2implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e。getSource( )==jb2){newjiemian2();o.dispose( );}}}classMyListener3implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e。getSource()==jb3){newjiemian3();o.dispose();}}}classMyListener4implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e.getSource( )==jb4){newjiemian4();o.dispose();}}}classMyListener5implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e.getSource()==jb5){newjiemian5();o.dispose( );}}}classMyListener6implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e.getSource()==jb6){newjiemian6();o。dispose( );}}}publicstaticvoidmain(String[]args){o=newjiemian();o。setDefaultCloseOperation(JFrame。EXIT_ON_CLOSE);o.setVisible(true);}}packageB;importjava。awt.FlowLayout;importjava。awt。event.ActionEvent;importjava。awt。event.ActionListener;importjavax.swing。ImageIcon;importjavax.swing。JButton;importjavax.swing.JFrame;importjavax.swing。JLabel;publicclassjiemian1extendsJFrame{JButtonjb3;staticjiemian1o;jiemian1(){this.setVisible(true);this。setTitle(”圖書采買”);this。setSize(600,400);this。setLocation(300,200);JLabeljl=newJLabel(newImageIcon(”g://2.)jpg");//增添背景JButtonjb1=newJButton(”訂單查問”);JButtonjb2=newJButton(”新書通告");jb3=newJButton("返回");this。add(jb1);this。add(jb2);this.add(jb3);this。setLayout(null);jl.setBounds(0,0,600,400);//設置背景大小this。add(jl);this。setLayout(newFlowLayout( ));this.setVisible(true);jb3.addActionListener(newMyListener3());}classM
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 婚慶花藝合同范本
- 代租鋪面出售合同范本
- 高三上學期9月物理周練四
- 室外施工合同協(xié)議書
- 危貨運輸合同范本
- 主動放棄租賃合同模板
- 家庭房屋繼承合同協(xié)議書
- 合作養(yǎng)魚協(xié)議合同模板
- it行業(yè)合同模板
- 修建木房合同模板
- 照度計算分解課件
- 煤礦總工程師技術手冊V1
- 二氧化碳跨臨界循環(huán)在熱泵熱水機組應用研究
- 《煤礦安全規(guī)程》專家解讀(詳細版)
- 網(wǎng)絡輿情課程教學大綱
- 膝關節(jié)階梯治療課件
- 四年級上冊數(shù)學課件-《練習一》北師大版 (共14張PPT)
- 儲氫材料簡介-課件
- 鍋爐工考試題庫及答案
- 地基基礎基本知識考試參考題庫500題(含答案)
- 廣聯(lián)達教程(學習大全)(精選)課件
評論
0/150
提交評論