📄 aboutp.java
字号:
package dialog;import java.awt.*;import java.net.*;import java.applet.*;import TFrame;import javax.swing.*;import java.awt.event.*;/** * Title: * Description: * Copyright: Copyright (c) 2001 * Company: * @author * @version 1.0 */public class AboutP extends JPanel{ Dialog m_dlg; Image m_img; Button button1 = new Button(); Panel panel1 = new Panel(); Label label1 = new Label(); Label label2 = new Label(); GridBagLayout gridBagLayout1 = new GridBagLayout(); public AboutP(Dialog d) { super(); m_dlg=d; try{ jbInit(); initImage(); }catch(Exception e){} } void initImage() { URL url=null; try{url=Class.forName("TFrame").getResource("about.gif"); }catch(Exception e){} m_img=getToolkit().getImage(url); MediaTracker mt=new MediaTracker(this); mt.addImage(m_img,1); try{ mt.wait(); mt.checkAll(); } catch(Exception e){} } public void paint(Graphics g) { g.drawImage(m_img,0,0,this); super.paint(g); } public AboutP() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { button1.setLabel("确 定"); button1.setBounds(new Rectangle(28, 65, 71, 29)); button1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { button1_actionPerformed(e); } }); this.setLayout(gridBagLayout1); panel1.setLayout(null); label1.setText("俄罗斯方块游戏"); label2.setText("作者:宋现锋"); label2.setBounds(new Rectangle(26, 30, 73, 18)); this.add(label1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(149, 142, 133, 166), 8, 0)); this.add(panel1, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0 ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(142, 133, 56, 147), 119, 101)); panel1.add(label2, null); panel1.add(button1, null); } void button1_actionPerformed(ActionEvent e) { m_dlg.dispose(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -