欢迎来到天天文库
浏览记录
ID:48806398
大小:484.56 KB
页数:29页
时间:2020-01-27
《操作系统课程设计银行家算法和页面置换算法.docx》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、南京工程学院操作系统课程设计说明书题目操作系统—银行家算法和页面置换算法班级软件101学生姓名刘洋学号202100320课设截图:源代码:3个类:MainFrame.java:importjava.awt.Font;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjavax.swing.ButtonGroup;importjavax.swing.JButton;importjavax.swing.JFrame;impor
2、tjavax.swing.JLabel;importjavax.swing.JPanel;importjavax.swing.JRadioButton;importjavax.swing.UIManager;importjavax.swing.UIManager.LookAndFeelInfo;publicclassMainFrameextendsJFrameimplementsActionListener{/****/privatestaticfinallongserialVersionUID=1L;privateJP
3、anelpanel1,panel2,panel3;privateJLabellabel1,label2;privateJButtonbutton1;privateJRadioButtonb1,b2;publicMainFrame(){super("操作系统课程设计");this.setBounds(300,150,800,500);this.setBackground(java.awt.Color.LIGHT_GRAY);this.setLayout(newjava.awt.GridLayout(3,1));panel1
4、=newJPanel();panel2=newJPanel();panel3=newJPanel();Fontf=newFont("楷体",1,60);Fontf1=newFont("宋体",3,30);Fontf2=newFont("幼圆",1,15);label1=newJLabel("操作系统课程设计");label1.setFont(f);label2=newJLabel("算法模拟题目:");label2.setFont(f1);panel1.add(label1);panel2.add(label2);But
5、tonGroupbgroup=newButtonGroup();b1=newJRadioButton("银行家算法",true);b1.setFont(f1);bgroup.add(b1);b2=newJRadioButton("页面置换算法");b2.setFont(f1);bgroup.add(b2);panel2.add(b1);panel2.add(b2);button1=newJButton("开始演示");button1.setFont(f2);button1.addActionListener(this);
6、panel3.add(button1);this.add(panel1);this.add(panel2);this.add(panel3);this.setDefaultCloseOperation(EXIT_ON_CLOSE);this.setVisible(true);}publicvoidactionPerformed(ActionEvente){if(e.getSource()==button1){if(b1.isSelected()){newBanker();}if(b2.isSelected()){newY
7、emian();}}}publicstaticvoidmain(String[]args){try{for(LookAndFeelInfoinfo:UIManager.getInstalledLookAndFeels()){if("Nimbus".equals(info.getName())){UIManager.setLookAndFeel(info.getClassName());break;}}}catch(Exceptione1){}newMainFrame();}}Banker.java:importjava.
8、awt.*;importjava.awt.event.*;importjava.util.ArrayList;importjavax.swing.*;importjavax.swing.table.DefaultTableCellRenderer;importjavax.swing.table.DefaultTabl
此文档下载收益归作者所有