?? removeitem.java
字號(hào):
package viewer;
import javax.swing.JLabel;
import java.awt.Rectangle;
import javax.swing.JTextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import controller.command.*;
import javax.swing.JOptionPane;
import java.awt.Point;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.BorderFactory;
import java.awt.Color;
import javax.swing.border.Border;
/**
* <p>Title: </p>
* 刪除操作框架
* <p>Description: </p>
* 用于刪除操作,文本框用于填入要?jiǎng)h除的題目標(biāo)識(shí)
*/
public class RemoveItem extends OperateFrame{
JLabel jLabel1 = new JLabel();
JTextField idTextField = new JTextField();
Border border1 = BorderFactory.createEtchedBorder(Color.white,
new Color(178, 178, 178));
Border border2 = BorderFactory.createEtchedBorder(Color.white,
new Color(178, 178, 178));
public RemoveItem() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
private void jbInit() throws Exception {
setSize(new Dimension(525, 440));
setTitle("OLTS System");
jLabel1.setFont(new java.awt.Font("幼圓", Font.PLAIN, 18));
jLabel1.setText("Please input the id that you want to delete");
jLabel1.setBounds(new Rectangle(53, 99, 392, 40));
idTextField.setBorder(border2);
this.getContentPane().add(jLabel1);
this.getContentPane().add(idTextField);
idTextField.setBounds(new Rectangle(195, 196, 145, 37));
super.subButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
trace();}
});
super.submitMenuItem.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
trace();}
});
super.submitButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
trace();}
});
}
/** 得到文本框內(nèi)容
* 調(diào)用RemoveCommand命令對(duì)submin命令進(jìn)行處理
* 成功刪除后,將文本框置空
*/
private void trace(){
String id = idTextField.getText();
OperateCommand rc = new RemoveCommand(id);
rc.excute();
idTextField.setText("");
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -