Fcfs

Páginas: 3 (545 palabras) Publicado: 27 de mayo de 2012
FCFS

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author mar.000
*/
import java.awt.BorderLayout;
importjava.awt.Container;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

class fcfs extends JFrameimplements ActionListener {

JButton jb[] = new JButton[3];
JTextField jt1[], jt2[];
JLabel jl[], jl1, jl2, jl3;
JPanel jp, jp1;
Container con;
int k, p;
String str[] ={"SUBMIT", "RESET", "EXIT"};
String str1[] = {"Procesos", "arribo", "tiempo salida", "WT", "FT", "TAT", "NTAT"};

public fcfs() {
super("fcfs scheduling algoritham");
con =getContentPane();

k = Integer.parseInt(JOptionPane.showInputDialog("Enter number of process"));

jl1 = new JLabel("Process");
jl2 = new JLabel("Arival Time");
jl3= new JLabel("Service Time");

jl = new JLabel[k];
jt1 = new JTextField[k];
jt2 = new JTextField[k];


for (int i = 0; i < k; i++) {
jl[i] = newJLabel("process " + (i + 1));
jt1[i] = new JTextField(10);
jt2[i] = new JTextField(10);
}

for (int i = 0; i < 3; i++) {
jb[i] = newJButton(str[i]);
}

con.setLayout(new GridLayout(k + 2, 3));
con.add(jl1);
con.add(jl2);
con.add(jl3);

int l = 0;

for (int i = 0; i < k; i++) {con.add(jl[l]);
con.add(jt1[l]);
con.add(jt2[l]);
l++;
}
l = 0;
for (int i = 0; i < 3; i++) {con.add(jb[l]);
jb[l].addActionListener(this);
l++;
}
}//end of constructor

@Override
public void actionPerformed(ActionEvent ae) {
int FT[] = new...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • FCFS
  • FCFS
  • Algoritmo Fcfs
  • Fcfs
  • Algoritmo De Planificacion Fcfs
  • Planificacion De Cpu Fcfs (First Come, First Served) — Presentation Transcript

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS