资源描述:
《javafsfcsjf带界面完整实现(源代码)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实用标准文案JavaFSFCSJF带界面完整实现(源代码)packagework1;importjava.awt.FileDialog;importjava.awt.Font;importjava.awt.GridLayout;importjava.awt.TextArea;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.awt.event.WindowAdapter;importjava.awt.event.WindowEvent;impo
2、rtjava.io.File;importjava.io.FileNotFoundException;importjava.io.FileReader;importjava.io.FileWriter;importjava.io.IOException;importjava.util.ArrayList;importjavax.swing.JButton;importjavax.swing.JFileChooser;importjavax.swing.JFrame;importjavax.swing.JOptionPane;importjavax.sw
3、ing.JPanel;importjavax.swing.JToolBar;importjavax.swing.filechooser.FileNameExtensionFilter;publicclassMainextendsJFrameimplementsActionListener{staticpublicTextAreatext,output0,output1;privateJFileChooserfchooser;FileDialogfile_dialog_load=newFileDialog(this,"Openfile...",FileD
4、ialog.LOAD);JPanelpan1=newJPanel();JPanelpan2=newJPanel();inttime=0;privateFilefile;publicMain(){//TODOAuto-generatedconstructorstubsuper("先来先服务FCFS和短作业优先SJF进程调度算法实现");Fontx=newFont("Serif",0,20);this.setBounds(400,300,900,900);this.setDefaultCloseOperation(HIDE_ON_CLOSE);this.t
5、ext=newTextArea("作业情况输入");text.setEditable(true);精彩文档实用标准文案text.setFont(x);//this.getContentPane().add(newJScrollPane(this.text),"Center");this.output0=newTextArea("FCFS");output0.setEditable(false);output0.setFont(x);//this.getContentPane().add(newJScrollPane(this.output0),"Sou
6、th");this.output1=newTextArea("SJF");output1.setEditable(false);output1.setFont(x);//this.getContentPane().add(newJScrollPane(this.output1),"North");pan1.setLayout(newGridLayout(3,1));pan1.add(text,"North");//pan2.setLayout(newGridLayout(2,1));pan1.add(output0,"Center");pan1.add
7、(output1,"South");getContentPane().add(pan1,"Center");//getContentPane().add(pan2,"South");///////////////////////////////////JToolBartoolbar=newJToolBar();this.getContentPane().add(toolbar,"North");JButtonbopen=newJButton("导入作业情况文件");bopen.addActionListener(this);toolbar.add(bo
8、pen);JButtonbsave0=newJButton("保存FCFS结果");bsave