91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 8KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-08
  • 語言: 其他
  • 標簽: GUI??

資源簡介

操作系統課設-頁面置換算法,實現FIFO、LRU、Clock三種置換算法,通過GUI界面展示。

資源截圖

代碼片段和文件信息

package?gui;

import?javax.swing.Jframe;
import?javax.swing.JPanel;
import?javax.swing.JScrollPane;
import?javax.swing.JButton;
import?javax.swing.JLabel;
import?javax.swing.JOptionPane;
import?javax.swing.JTextArea;
import?java.awt.Color;
import?java.awt.event.ActionEvent;
import?java.awt.event.ActionListener;


import?javax.swing.JTextField;

import?utils.ListUtils;

public?class?Animationframe?extends?Jframe?{


private?static?final?long?serialVersionUID?=?1L;

//?訪問序列長度
private?int?count;
//?內存塊數
private?int?memory;
//?數據
private?object[][]?data;
//?訪問序列
private?String[]?accessSequence;

ClockThread?clockThread;
//?內存塊
private?JTextField[]?textField;
//?當前訪問頁面
JTextArea?current;

public?Animationframe(int?memory?String[]?accessSequence?object[][]?data)?{

count?=?accessSequence.length;
this.memory?=?memory;
this.data?=?data;
this.accessSequence?=?accessSequence;

Jframe?animationframe?=?new?Jframe();
animationframe.settitle(“頁面置換算法動態演示“);
animationframe.setBounds(550?260?541?562);
animationframe.setDefaultCloseOperation(2);
animationframe.getContentPane().setLayout(null);

JPanel?functionPanel?=?new?JPanel();
functionPanel.setBackground(Color.WHITE);
functionPanel.setBounds(10?10?224?453);
animationframe.getContentPane().add(functionPanel);
functionPanel.setLayout(null);

JButton?autoRun?=?new?JButton(“運行“);
autoRun.setBounds(33?72?93?23);
functionPanel.add(autoRun);

JLabel?lab1?=?new?JLabel(“當前訪問頁面:“);
lab1.setBounds(33?221?93?23);
functionPanel.add(lab1);

current?=?new?JTextArea();
current.setBounds(136?221?63?24);
functionPanel.add(current);

JButton?stop?=?new?JButton(“停止“);
stop.setBounds(33?137?93?23);
functionPanel.add(stop);

JScrollPane?scrollPane?=?new?JScrollPane();
scrollPane.setBounds(244?10?257?453);
animationframe.getContentPane().add(scrollPane);

JPanel?showPanel?=?new?JPanel();
showPanel.setBackground(Color.WHITE);
scrollPane.setViewportView(showPanel);
showPanel.setLayout(null);

textField?=?new?JTextField[memory];


/*textField1?=?new?JTextField();
textField1.setBounds(80?167?86?37);
showPanel.add(textField1);*/
for(int?i?=?0;?i? JTextField?text?=?new?JTextField();
text.setBounds(80?108?+?i?*?59?86?37);
text.setText(““);
textField[i]?=?text;
showPanel.add(textField[i]);
}

animationframe.setVisible(true);

autoRun.addActionListener(new?ActionListener()?{

@Override
public?void?actionPerformed(ActionEvent?e)?{

clockThread?=?new?ClockThread(Animationframe.this);
clockThread.start();
}
});

stop.addActionListener(new?ActionListener()?{

@Override
public?void?actionPerformed(ActionEvent?e)?{
clockThread.exit?=?true;
}
});

}

//?當前計數
private?int?currentCount?=?0;


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????4640??2018-06-04?21:57??gui\Animationframe.java
?????文件???????18997??2018-06-04?21:51??gui\Arithmetic.java
?????文件????????3510??2018-06-03?16:05??gui\Initframe.java
?????文件?????????851??2018-06-04?11:45??gui\TestOne.java
?????文件????????2878??2018-06-04?21:24??utils\ListUtils.java

評論

共有 條評論