⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 removeitem.java

📁 利用JAVA开发的简单考试系统
💻 JAVA
字号:
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>
 * 用于删除操作,文本框用于填入要删除的题目标识
 */
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();}
      });

 }
 /** 得到文本框内容
  *  调用RemoveCommand命令对submin命令进行处理
  *  成功删除后,将文本框置空
  */
 private void trace(){
      String id = idTextField.getText();
      OperateCommand rc = new RemoveCommand(id);
      rc.excute();
      idTextField.setText("");
   }

}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -