📄 jvideoplayerframe.java~1~
字号:
package jvideosystem;import java.awt.*;import java.awt.event.*;import javax.swing.*;/** * <p>Title: 格律诗@kk</p> * <p>Description: 格律诗Digtalplayer</p> * <p>Copyright: Copyright (c) 2007</p> * <p>Company: KK格律诗</p> * @author 吴凯 * @version 1.0 */public class JVideoPlayerFrame extends JFrame { JPanel contentPane; JMenuBar jMenuBar1 = new JMenuBar(); JMenu jMenuFile = new JMenu(); JMenuItem jMenuFileExit = new JMenuItem(); JMenu jMenuHelp = new JMenu(); JMenuItem jMenuHelpAbout = new JMenuItem(); BorderLayout borderLayout1 = new BorderLayout(); //Construct the frame public JVideoPlayerFrame() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(borderLayout1); this.setSize(new Dimension(400, 300)); this.setTitle("格律诗@kk播放器"); jMenuFile.setText("File"); jMenuFileExit.setText("Exit"); jMenuFileExit.addActionListener(new JVideoPlayerFrame_jMenuFileExit_ActionAdapter(this)); jMenuHelp.setText("Help"); jMenuHelpAbout.setText("About"); jMenuHelpAbout.addActionListener(new JVideoPlayerFrame_jMenuHelpAbout_ActionAdapter(this)); jMenuFile.add(jMenuFileExit); jMenuHelp.add(jMenuHelpAbout); jMenuBar1.add(jMenuFile); jMenuBar1.add(jMenuHelp); this.setJMenuBar(jMenuBar1); } //File | Exit action performed public void jMenuFileExit_actionPerformed(ActionEvent e) { System.exit(0); } //Help | About action performed public void jMenuHelpAbout_actionPerformed(ActionEvent e) { JVideoPlayerFrame_AboutBox dlg = new JVideoPlayerFrame_AboutBox(this); Dimension dlgSize = dlg.getPreferredSize(); Dimension frmSize = getSize(); Point loc = getLocation(); dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y); dlg.setModal(true); dlg.pack(); dlg.show(); } //Overridden so we can exit when window is closed protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { jMenuFileExit_actionPerformed(null); } }}class JVideoPlayerFrame_jMenuFileExit_ActionAdapter implements ActionListener { JVideoPlayerFrame adaptee; JVideoPlayerFrame_jMenuFileExit_ActionAdapter(JVideoPlayerFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jMenuFileExit_actionPerformed(e); }}class JVideoPlayerFrame_jMenuHelpAbout_ActionAdapter implements ActionListener { JVideoPlayerFrame adaptee; JVideoPlayerFrame_jMenuHelpAbout_ActionAdapter(JVideoPlayerFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jMenuHelpAbout_actionPerformed(e); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -