Code:
import java.awt.*; //import statements include other classes into this code piece
import java.applet.*;
public class acceptvalues extends applet //create a public class named acceptvalues which is also an applet. (btw, applet should be Applet)
{
Textfield textfield; //create a text box
public void init(); //duh...
{
textfield=new textfield(10); //textfield is 10 characters long (i think)
add(textfield); //not sure
}
public void paint(Graphics g) //everytime the applet needs to be repainted
{ // like when you restore a window with the applet in it, or you drag a window across the applet
g.drawstring("The value is:",100,100); //draw graphical text at 100,100
}
public boolean action(Event event,object arg) // for mouse clicks, etc..
{
repaint();
return true;
}
}
i'm no java expert