?? operateframe.java
字號:
package viewer;
import javax.swing.JPanel;
import java.awt.Rectangle;
import javax.swing.JButton;
import model.persistency.PersistentItem;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JOptionPane;
import java.awt.Point;
import java.awt.Dimension;
/**
* <p>Title: </p>
* 管理操作框架
* <p>Description: </p>
* 此框架是整個管理操作的父框架,同時又是UserFrame的子框架。
* 該框架有一個submit按鈕,用于提交操作結果
* 對父類的end命令重新定義操作
*/
public class OperateFrame extends UserFrame{
PersistentItem t;
JButton subButton = new JButton();
/**
* constructor
*/
public OperateFrame() {
super();
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
private void jbInit() throws Exception {
// this.setJMenuBar(jMenuBar1);
setSize(new Dimension(525, 440));
setTitle("OLTS System");
subButton.setActionCommand("subButton");
subButton.setBounds(new Rectangle(230, 353, 81, 26));
subButton.setText("Submit");
super.endButton.addActionListener(new endButton_actionAdapter(this));
super.endMenuItem.addActionListener(new endButton_actionAdapter(this));
this.getContentPane().add(subButton);
}
/**
* 對父類的end菜單項和end按鈕進行重新定義監聽事件
* 銷毀當前操作框架,生成UserFrame框架
* @param e ActionEvent
*/
public void endButton_actionPerformed(ActionEvent e) {
this.dispose();
UserFrame frame = new UserFrame();
frame.setVisible(true);}
}
class endButton_actionAdapter implements ActionListener {
private OperateFrame adaptee;
endButton_actionAdapter(OperateFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.endButton_actionPerformed(e);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -