資源簡介
用java寫的單功能流水線調度程序,屬于體系結構范疇

代碼片段和文件信息
import?java.awt.*;
import?java.awt.event.*;
import?javax.swing.*;
import?javax.swing.table.*;
public?class?WaterLine?extends?frame?{
public?static?void?main(String[]?args)?{
WaterLine?lruc?=?new?WaterLine();
lruc.lauchframe();
}
Graphics?g;
Label?jlabel1;
//Label?jlabel2;
TextArea?jta1;
TextField?jtf2;
//TextField?jtf3;
Button?jb_input;
//Button?run;
JScrollPane?jsp;
JTable?jt;
DefaultTableModel?dtm;
static?String?timeslice;
public?void?lauchframe()?{
this.setLayout(null);
this.setBounds(100?100?600?500);
this.setBackground(Color.cyan);
this.setVisible(true);
jlabel1?=?new?Label(“請輸入一個時間塊:“);
//jlabel2?=?new?Label(“請輸入設備內容:“);
jta1?=?new?TextArea();
jtf2?=?new?TextField();
//jtf3?=?new?TextField();
jb_input?=?new?Button(“輸入“);?
//run?=?new?Button(“運行通道管理器“);
jlabel1.setBounds(50?50?110?20);
//jlabel2.setBounds(230?50?90?20);
jta1.setBounds(50?100?500?150);
jtf2.setBounds(170?50?70?20);
//jtf3.setBounds(330?50?90?20);
jb_input.setBounds(450?50?60?20);
//run.setBounds(450?260?100?20);
this.add(jlabel1);
//this.add(jlabel2);
this.add(jta1);
this.add(jtf2);
//this.add(jtf3);
this.add(jb_input);
//this.add(run);
this.addWindowListener(new?WindowAdapter()?{
public?void?windowClosing(WindowEvent?e)?{
System.exit(0);
}
});
jb_input.addActionListener(new?InputActionListener());
jb_input.addActionListener(new?RunActionListener());
jta1.addKeyListener(new?TextAreaThread());
g?=?this.getGraphics();
new?Thread(new?PaintThread()).start();
jta1.append(“---------------------Deno?the?pipline?for?float?point?add.---------------------\n“);
jta1.append(“-----------------We?want?to?execute?5?float?poing?instructions-----------------\n“);
jta1.append(“Here?we?display?all?the?content?in?the?pipline:\n“);
jta1.append(“Please?input?a?time?slice:\n“);
//jta1.append(“?“?+?NL[0]?+?“?“?+?NL[1]?+?“?“?+?NL[2]);
}
class?InputActionListener?implements?ActionListener?{
public?void?actionPerformed(ActionEvent?e)?{
if(jtf2.getText().equals(““))?{
object[]?options?=?{?“OK“?};
JOptionPane.showOptionDialog(null?“你的輸入存在“”,請按提示輸入!“?“警告“?
JOptionPane.DEFAULT_OPTION?JOptionPane.WARNING_MESSAGE
null?options?options[0]);
}
timeslice?=?jtf2.getText();
jta1.append(jtf2.getText()?+?“\n“);
jtf2.setText(““);
?
}
}
class?RunActionListener?implements?ActionListener?{
public?void?actionPerformed(ActionEvent?e)?{
new?Thread(new?TextAreaThread()).start();
}
}
class?Painting?{
int?x?y?width?height;
Color?color;
String?s;
Boolean?flag;
public?Painting(int?x?int?yint?width?int?height?Color?color?String?s?Boolean?flag)?{
this.x?=?x;
this.y?=?y;
this.width?=?width;
this.height?=?height;
this.color?=?color;
this.s?=?s;
this.flag?=?flag;
}
public?voi
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????14161??2009-04-28?10:51??WaterLine.java
-----------?---------??----------?-----??----
????????????????14161????????????????????1
- 上一篇:Java實現高級計算器
- 下一篇:安卓手機課程表應用
評論
共有 條評論