📄 yinyue.java~25~
字号:
package one_piece;import java.awt.*;import javax.swing.*;import com.borland.jbcl.layout.*;import java.awt.event.*;import java.io.*;import javax.swing.border.*;/** * <p>Title: ONE PIECE</p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class yinyue extends JDialog { JPanel panel1 = new JPanel(); XYLayout xYLayout1 = new XYLayout(); JButton jButton1 = new JButton(); JButton jButton2 = new JButton(); private java.applet.AudioClip audioClip; java.net.URL url;CHUANGTI CHUANGTI; Border border1; Border border2; JLabel jLabel1 = new JLabel(); public yinyue(Frame frame, String title, boolean modal) { super(frame, title, modal); try { myinit(); jbInit(); pack(); } catch(Exception ex) { ex.printStackTrace(); } } public yinyue() { this(null, "", false); } private void jbInit() throws Exception { border1 = BorderFactory.createMatteBorder(6,6,6,6,SystemColor.menuText); border2 = BorderFactory.createMatteBorder(6,6,6,6,SystemColor.windowText); panel1.setLayout(xYLayout1); jButton1.setBackground(Color.blue); jButton1.setBorder(border1); jButton1.setIcon(new ImageIcon(new java.net.URL("file:///E:/Picture/kai.gif"))); jButton1.setText("开始"); jButton1.addActionListener(new yinyue_jButton1_actionAdapter(this)); jButton2.setBackground(Color.blue); jButton2.setBorder(border2); jButton2.setIcon(new ImageIcon(new java.net.URL("file:///E:/Picture/shu.gif"))); jButton2.setText("结束"); jButton2.addActionListener(new yinyue_jButton2_actionAdapter(this)); panel1.setBackground(Color.blue); panel1.setForeground(Color.red); jLabel1.setIcon(new ImageIcon(new java.net.URL("file:///E:/Picture/yinyue.gif"))); jLabel1.setText(""); getContentPane().add(panel1); panel1.add(jButton1, new XYConstraints(22, 37, 102, -1)); panel1.add(jButton2, new XYConstraints(144, 92, 100, 61)); panel1.add(jLabel1, new XYConstraints(1, 2, -1, -1)); } public void myinit() { try{ java.net.URL url = new java.net.URL("file:///E:mc/bg2.mid"); audioClip = java.applet.Applet.newAudioClip(url); } catch(Exception e){ System.out.println("ONFINLD"); } } void jButton1_actionPerformed(ActionEvent e) { audioClip.loop(); } void jButton2_actionPerformed(ActionEvent e) { audioClip.stop(); CHUANGTI.requestFocus();//将焦点设置回到游戏区域 this.dispose(); }}class yinyue_jButton1_actionAdapter implements java.awt.event.ActionListener { yinyue adaptee; yinyue_jButton1_actionAdapter(yinyue adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton1_actionPerformed(e); }}class yinyue_jButton2_actionAdapter implements java.awt.event.ActionListener { yinyue adaptee; yinyue_jButton2_actionAdapter(yinyue adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton2_actionPerformed(e); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -