import java.awt.*; import java.awt.event.*; public class detddbd extends java.applet.Applet implements ActionListener { public final int MAXTIME = 50; public final int PRNTTIME = 1; private double alpha, k, beta; public void init() /* first method run by the applet, always. */ /* adds applet components to the frame, begins running of the */ /* simulation */ { setBackground(Color.white); setForeground(Color.black); display = new TextArea("",30,60,TextArea.SCROLLBARS_VERTICAL_ONLY); run = new Button("run"); add(display); add(run); run.addActionListener(this); } public void actionPerformed(ActionEvent event) /* method performed when a button is pressed or another */ /* action is performed */ { Object cause = event.getSource(); if (cause == run) { run.setEnabled(false); RunSim(); run.setEnabled(true); } } public void RunSim() { display.setText(""); double n1,n2,n3,n4,n5; alpha = 0.2; beta = 0.1; k = 40.0; for(int ttt=0;ttt