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

📄 makelistdlg.java~10~

📁 进程调度和存储管理模拟
💻 JAVA~10~
字号:
package cn.edu.cauc.crab.ossimulate;import java.awt.*;import javax.swing.*;import com.borland.jbcl.layout.*;import java.awt.event.*;/** * <p>Title: OS simulate</p> * <p>Description: This is my home work.</p> * <p>Copyright: Copyleft (c) 2004</p> * <p>Company: CAUC</p> * @author Crab * @version 0.1 */public class MakeListDLG extends JDialog {    ProcessSchedule pSch;    private JPanel panel1 = new JPanel();    private XYLayout xYLayout1 = new XYLayout();    private JScrollPane jScrollPane1 = new JScrollPane();    private JTextArea outTA = new JTextArea();    private JTextField arriveTime = new JTextField();    private JLabel jLabel1 = new JLabel();    private JLabel jLabel2 = new JLabel();    private JTextField serveTime = new JTextField();    private JButton add = new JButton();    private JButton finish = new JButton();    public MakeListDLG(Frame frame, String title, boolean modal) {        super(frame, title, modal);        try {            jbInit();            pack();        }        catch(Exception ex) {            ex.printStackTrace();        }    }    public MakeListDLG(ProcessSchedule pSch) {        this(null, "添加进程/作业列表", false);        this.pSch = pSch;    }    private void jbInit() throws Exception {        panel1.setLayout(xYLayout1);        jLabel1.setToolTipText("");        jLabel1.setText("进程/作业到达时间:");        jLabel2.setText("进程需要服务时间:");        add.setText("添加");        add.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(ActionEvent e) {                add_actionPerformed(e);            }        });        finish.setText("完成");        getContentPane().add(panel1, BorderLayout.CENTER);        panel1.add(jScrollPane1,  new XYConstraints(182, 11, 207, 284));        jScrollPane1.getViewport().add(outTA, null);        panel1.add(jLabel1,   new XYConstraints(8, 27, -1, 22));        panel1.add(arriveTime,   new XYConstraints(122, 29, 56, 17));        panel1.add(jLabel2,  new XYConstraints(7, 54, 109, 17));        panel1.add(serveTime, new XYConstraints(122, 55, 56, 17));        panel1.add(add, new XYConstraints(20, 90, 131, 24));        panel1.add(finish,  new XYConstraints(20, 132, 132, 27));    }    void add_actionPerformed(ActionEvent e) {        try {            int at = Integer.parseInt(arriveTime.getText());            int st = Integer.parseInt(serveTime.getText());            pSch.addProcess(new Process(st), at);            outTA.append("到达时间:" + at + " 服务时间:" + st);            serveTime.setText("");            arriveTime.setText("");        } catch (Exception ex) {            JOptionPane.showMessageDialog(this, ex);        }    }}

⌨️ 快捷键说明

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