操作系统课程设计银行家算法和页面置换算法464.docx
《操作系统课程设计银行家算法和页面置换算法464.docx》由会员分享,可在线阅读,更多相关《操作系统课程设计银行家算法和页面置换算法464.docx(49页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、 南京工程学院院操作系统课程设设计说明书题 目 操作作系统银行行家算法和页页面置换算法法 班班 级 软件1001 学 生 姓 名名 刘 洋 学 号 22021000320 课设截图:源代码:3个类:MainFraame.jaava:import java.awt.FFont;import java.awt.eevent.ActioonEvennt;import java.awt.eevent.ActioonListtener;import javaxx.swinng.ButttonGrroup;import javaxx.swinng.JBuutton;import javaxx.swinng
2、.JFrrame;import javaxx.swinng.JLaabel;import javaxx.swinng.JPaanel;import javaxx.swinng.JRaadioBuutton;import javaxx.swinng.UIMManageer;import javaxx.swinng.UIMManageer.LoookAndFFeelInnfo;public classs MainnFramee exteends JJFramee impllementts ActtionLiisteneer /* * */ privvate sstaticc finaal lonn
3、g serrialVeersionnUID = 1L; privvate JPaneel pannel1,ppanel22,paneel3; privvate JLabeel labbel1,llabel22; privvate JButtton buutton11; privvate JRadiioButtton b11,b2; publlic MainFFrame() supper(操操作系统课程程设计); thiis.settBoundds(300, 150, 800, 500); thiis.settBackggroundd(java.awt.CColor.LIGHTT_GRAYY);
4、 thiis.settLayouut(new jaava.awwt.GriidLayoout(3, 1); pannel1=nnew JPPanel(); pannel2=nnew JPPanel(); pannel3=nnew JPPanel(); Fonnt f =new FFont(楷体,1,60); Fonnt f1=new FFont(宋体,3,30); Fonnt f2=new FFont(幼圆,1,15); labbel1=nnew JLLabel(操作系统统课程设计); labbel1.ssetFonnt(f); labbel2=nnew JLLabel(算法模拟拟题目:);
5、labbel2.ssetFonnt(f1); pannel1.aadd(laabel1); pannel2.aadd(laabel2); ButttonGrroup bgrouup=neww ButttonGrooup(); b1=new JJRadiooButtoon(银行家算算法,trrue); b1.setFoont(f11); bgrroup.aadd(b1); b2=new JJRadiooButtoon(页面置换换算法); b2.setFoont(f11); bgrroup.aadd(b2); pannel2.aadd(b11); pannel2.aadd(b22); buttto
6、n1=new JJButtoon(开始演示示); buttton1.setFoont(f22); buttton1.addAcctionLListenner(thhis); pannel3.aadd(buutton11); thiis.addd(panell1); thiis.addd(panell2); thiis.addd(panell3); thiis.settDefauultClooseOpeeratioon(EXIT_ON_CLLOSE); thiis.settVisibble(true); publicc voidd actiionPerrformeed(ActioonEvennt
7、 e) if(e.getSoource()=buutton11)if(bb1.isSSelectted() neww Bankker();if(bb2.isSSelectted()neww Yemiaan();publicc stattic vooid maain (SStringg arrgs) tryfor(LLookAnndFeellInfo info : UIMManageer.gettInstaalledLLookAnndFeells()if(Nimbuus.eqquals(info.getNaame()UIMManageer.settLookAAndFeeel(info.getCl
8、lassNaame();breeak;catchh(Exceeptionn e1) new MainFFrame(); Banker.java:import java.awt.*;import java.awt.eevent.*;import java.util.ArrayyList;import javaxx.swinng.*;import javaxx.swinng.tabble.DeefaulttTableeCellRRenderrer;import javaxx.swinng.tabble.DeefaulttTableeModell; publicc classs Baanker ex
9、tennds JFFrame impleementss ActiionLisstenerr /* * */privatte staatic ffinal long seriaalVerssionUIID = 11L;privatte JTablle tabble1,ttable22; priivate JPaneel p0,p1,p111,p122,p13,p14,pp2,p3,p31,pp32,p333,p344,p4,pp5; priivate JLabeel t1,t2,t33,t4,tt5,t6,t7,t88,t9,tt10,t111; priivate JButtton b11,b2
10、,bb3,b4,b5,b66; priivate TextFField text001,texxt02,ttext033,textt04,teext05,text006;/编编辑框 priivate JTexttFieldd ttext1,text22,textt3,texxt4,teext5;/进程组的的数据 DeffaultTTableMModel tableemodell,tabllemodeel1; ArrrayLisst listt ; intt cllaim,aallocaation,need; intt avaailablle;int requeest,teemavaiil,re
11、llease; booolean posssiblee; intt m,n,iindex=0; pubblic BBankerr() suuper(银行家算法法模拟); p00=new JPaneel(); p11=new JPaneel(); p111=neww JPannel(); p112=neww JPannel(); p113=neww JPannel(); p114=neww JPannel(); p22=new JPaneel(); p33=new JPaneel(); p331=neww JPannel(); p332=neww JPannel(); p333=neww JPa
12、nnel(); p334=neww JPannel(); p44=new JPaneel(); p55=new JPaneel(); p00.setLLayoutt(new GridLLayoutt(5,1); p11.setLLayoutt(new GridLLayoutt(4,1); p33.setLLayoutt(new GridLLayoutt(4,1); p11.add(p11); p11.add(p12); p11.add(p13); p11.add(p14); p33.add(p31); p33.add(p32); p33.add(p33); p33.add(p34); p00.
13、add(p1); p00.add(p2); p00.add(p3); p00.add(p4); p00.add(p5); t1=nnew JLLabel(进程数); t2=nnew JLLabel(资源数); t3=nnew JLLabel(进程号); t4=nnew JLLabel(已分配资资源:); t5=nnew JLLabel(资源最大大需求:); t6=nnew JLLabel(可用资源源:); t7=nnew JLLabel(请求资源源进程号); t8=nnew JLLabel(请求资源源为); t9=nnew JLLabel(释放资源源); t10=new JJLabell(安全
14、序列列); t11=new JJLabell(释放资源源进程号); b1=nnew JBButtonn(确定); b2=nnew JBButtonn(添加); b3=nnew JBButtonn(确定); b4=nnew JBButtonn(请求); b5=nnew JBButtonn(开始检测测); b6=nnew JBButtonn(释放); textt1=neww JTexxtFielld6; textt2=neww JTexxtFielld6; textt3=neww JTexxtFielld6; textt4=neww JTexxtFielld6; textt5=neww JTexx
15、tFielld6; for(int i=0;i55;i+) texxt1i=new JTexttFieldd(4); text22i=nnew JTTextFiield(44); text33i=nnew JTTextFiield(44); text44i=nnew JTTextFiield(44); text55i=nnew JTTextFiield(44); textt01=neew TexxtFielld(4); textt02=neew TexxtFielld(4); textt03=neew TexxtFielld(4); textt04=neew TexxtFielld(4); t
16、extt05=neew TexxtFielld(4); textt06=neew TexxtFielld(20); Striing colummnNamees1= 进程号, alloocatioon,cclaim,neeed,aavailaable; taablemoodel=new DeefaulttTableeModell(coluumnNammes1,00); taable1 = neww JTabble (tabllemodeel); taable1.setPrreferrredScrrollabbleVieewporttSize(new DDimenssion(7700, 2200)
17、; taable1.setRoowHeigght (220); taable1.doLayyout (); DeefaulttTableeCellRRenderrer r = neww DefaaultTaableCeellRenndererr(); r.settHorizzontallAlignnment(JLabeel.CENNTER); tablee1.settDefauultRenndererr(Objeect.cllass,rr); JSScrolllPane pane11 = neew JSccrollPPane (tablee1); p11.add(tt1); p11.add(t
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 操作系统 课程设计 银行家 算法 页面 置换 464
限制150内