could someone help me with the rest of this coding please import java.applet.Applet; import java.awt.*; import java.awt.event.*;
public class guessnumber extends Applet implements Runnable, ActionListener { String msg; Thread t = null; int state; boolean stopflag; private Label l1, l2; private TextField t1, t2; private Button b1; private int num, mynum, diff, red, blue, green, chance = 0; private Color c;
public void init() { c = new Color( 0, 80, 0 ); setForeground( c ); l1 = new Label("I have kept a number between 1 and 1000."); l2 = new Label("Can you guess this number?"); t1 = new TextField(10); t2 = new TextField(10); b1 = new Button("Play Again"); t2.setEditable(false); add(l1); add(l2); add(t1); add(t2); add(b1);
t 1.addActionListener(this); b1.addActionListener(this); num = 1 + (int) (Math.random()*1000); }
public void start() { msg = getParameter( "message" ); if(msg == null) { msg = "Message not found"; } msg = " " + msg; t = new Thread( this ); stopflag = false; t.start(); }