欢迎来到天天文库
浏览记录
ID:6785880
大小:99.50 KB
页数:30页
时间:2018-01-25
《java纸牌游戏源代码》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、AboutDialog.java程序importjavax.swing.JDialog;importjavax.swing.JFrame;importjava.awt.Point;importjavax.swing.JTabbedPane;importjavax.swing.JPanel;importjavax.swing.JButton;importjavax.swing.JLabel;/**创建日期2005-7-10TODO要更改此生成的文件的模板,请转至窗口-首选项-Java-代码样式-代码模板*//**@*downloadbyhtt
2、p://www.codefans.net*@author叶少伟TODO要更改此生成的类型注释的模板,请转至窗口-首选项-Java-代码样式-代码模板*/publicclassAboutDialogextendsJDialog{privatejavax.swing.JPaneljContentPane=null;protectedJFrameowner=null;privateJTabbedPanejTabbedPane=null;privateJPaneljPanel=null;privateJPaneljPanel1=null;priva
3、teJPaneljPanel2=null;privateJPaneljPanel3=null;privateJPaneljPanel4=null;privateJButtonjButton=null;privateJLabeljLabel=null;privateJLabeljLabel1=null;privateJLabeljLabel2=null;privateJLabeljLabel3=null;/***Thisisthedefaultconstructor*/publicAboutDialog(JFrameframe){super(
4、frame);owner=frame;setResizable(false);initialize();}/***Thismethodinitializesthis**@returnvoid*/privatevoidinitialize(){this.setTitle("关于对话框");this.setSize(209,132);this.setContentPane(getJContentPane());this.setLocation();this.setVisible(true);this.addWindowListener(newj
5、ava.awt.event.WindowAdapter(){publicvoidwindowClosing(java.awt.event.WindowEvente){owner.setEnabled(true);AboutDialog.this.dispose();}});}/***ThismethodinitializesjContentPane**@returnjavax.swing.JPanel*/privatejavax.swing.JPanelgetJContentPane(){if(jContentPane==null){jCo
6、ntentPane=newjavax.swing.JPanel();jContentPane.setLayout(newjava.awt.BorderLayout());jContentPane.add(getJTabbedPane(),java.awt.BorderLayout.CENTER);jContentPane.add(getJPanel4(),java.awt.BorderLayout.SOUTH);}returnjContentPane;}privatevoidsetLocation(){Pointpoint=owner.ge
7、tLocation();intwidth=this.getWidth();intheight=this.getHeight();intx=(int)(point.getX()+(owner.getWidth()-width)/2);x=(x>1024-width?1024-width:x);x=(x<0?0:x);inty=(int)(point.getY()+(owner.getHeight()-height)/2);y=(y>768-height?768-height:y);y=(y<0?0:y);setLocation(x,y);}/
8、***ThismethodinitializesjTabbedPane**@returnjavax.swing.JTabbedPane*/privateJTabbedPanege
此文档下载收益归作者所有