資源簡介
操作系統(tǒng)頁面置換算法-java界面化實(shí)現(xiàn),并將整個過程動態(tài)地演示出來

代碼片段和文件信息
package?wy;
import?java.awt.Color;
import?java.awt.Component;
import?java.awt.event.ActionEvent;
import?java.awt.event.ActionListener;
import?javax.swing.ButtonGroup;
import?javax.swing.ImageIcon;
import?javax.swing.JButton;
import?javax.swing.Jframe;
import?javax.swing.JLabel;
import?javax.swing.JOptionPane;
import?javax.swing.JPanel;
import?javax.swing.JRadioButton;
import?javax.swing.JScrollPane;
import?javax.swing.JTable;
import?javax.swing.JTextField;
import?javax.swing.border.EmptyBorder;
import?javax.swing.table.DefaultTableCellRenderer;
import?javax.swing.table.DefaultTableModel;
import?javax.swing.table.TableCellRenderer;
import?java.awt.SystemColor;
public?class?AlgorithmForm?extends?Jframe?{
public?JPanel?contentPane;
public?JScrollPane?jspResult;
public?JTable?tabResult;
double?rate1?=?0?rate2?=?0?rate3?=?0;
public?AlgorithmForm(final?int[]?seq?final?int?block)?{
setResizable(false);
settitle(“算法“);
setDefaultCloseOperation(Jframe.EXIT_ON_CLOSE);
setBounds(100?100?872?566);
contentPane?=?new?JPanel();
contentPane.setBorder(new?EmptyBorder(5?5?5?5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel?label1?=?new?JLabel(“FIFO命中率“);
JLabel?label2?=?new?JLabel(“LRU命中率“);
JLabel?label3?=?new?JLabel(“OPT命中率“);
JButton?button?=?new?JButton(“最優(yōu)“);
label1.setBounds(33?190?80?23);
label2.setBounds(33?243?80?23);
label3.setBounds(33?296?80?23);
button.setBounds(33?362?80?23);
contentPane.add(label1);
contentPane.add(label2);
contentPane.add(label3);
contentPane.add(button);
final?JTextField?textField1?=?new?JTextField();
final?JTextField?textField2?=?new?JTextField();
final?JTextField?textField3?=?new?JTextField();
final?JTextField?textField4?=?new?JTextField();
textField1.setBounds(33?210?80?23);
textField2.setBounds(33?263?80?23);
textField3.setBounds(33?316?80?23);
textField4.setBounds(33?382?80?23);
contentPane.add(textField1);
contentPane.add(textField2);
contentPane.add(textField3);
contentPane.add(textField4);
final?JRadioButton?rdbtnFIFO?=?new?JRadioButton(“FIFO“);
rdbtnFIFO.setBackground(SystemColor.info);
rdbtnFIFO.setBounds(33?48?62?23);
contentPane.add(rdbtnFIFO);
final?JRadioButton?rdbtnLRU?=?new?JRadioButton(“LRU“);
rdbtnLRU.setBackground(SystemColor.info);
rdbtnLRU.setBounds(33?73?62?23);
contentPane.add(rdbtnLRU);
final?JRadioButton?rdbtnOPT?=?new?JRadioButton(“OPT“);
rdbtnOPT.setBackground(SystemColor.info);
rdbtnOPT.setBounds(33?98?62?23);
contentPane.add(rdbtnOPT);
ButtonGroup?algoBtn?=?new?ButtonGroup();
algoBtn.add(rdbtnOPT);
algoBtn.add(rdbtnFIFO);
algoBtn.add(rdbtnLRU);
JLabel?lab1?=?new?JLabel(“選擇算法:“);
lab1.setBounds(33?27?77?15);
contentPane.add(lab1);
JButton?btnOK?=?new?JButton(“確定“);
btnOK.setBounds(33?127?62?23);
contentPane.a
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????508??2014-03-16?23:27??wy\.svn\all-wcprops
?????文件????????857??2014-03-16?23:27??wy\.svn\entries
?????文件???????7897??2014-03-16?23:27??wy\.svn\text-ba
?????文件???????4624??2014-03-16?23:27??wy\.svn\text-ba
?????文件???????4694??2014-03-16?23:27??wy\.svn\text-ba
?????文件???????1739??2014-03-16?23:27??wy\.svn\text-ba
?????文件???????8542??2014-03-18?16:33??wy\AlgorithmForm.java
?????文件???????4737??2014-03-19?16:39??wy\MainForm.java
?????文件???????4716??2014-03-19?17:05??wy\Memory.java
?????文件???????5695??2014-03-18?16:39??wy\OneByOne.java
?????文件???????1633??2014-03-19?16:06??wy\RandomAddress.java
?????目錄??????????0??2014-03-16?23:27??wy\.svn\tmp\prop-ba
?????目錄??????????0??2014-03-16?23:27??wy\.svn\tmp\props
?????目錄??????????0??2014-03-16?23:27??wy\.svn\tmp\text-ba
?????目錄??????????0??2014-03-16?23:27??wy\.svn\prop-ba
?????目錄??????????0??2014-03-16?23:27??wy\.svn\props
?????目錄??????????0??2014-03-16?23:27??wy\.svn\text-ba
?????目錄??????????0??2014-03-16?23:27??wy\.svn\tmp
?????目錄??????????0??2014-03-16?23:27??wy\.svn
?????目錄??????????0??2015-04-13?16:54??wy
-----------?---------??----------?-----??----
????????????????45642????????????????????20
評論
共有 條評論