James Hancock
asked on
Why doesn't this text field show up on my Applet frame?
Hi
In the applet code below, the one numberField textfield doesn't show, go visible and it is flabbergasting me. wth?
Thanks
In the applet code below, the one numberField textfield doesn't show, go visible and it is flabbergasting me. wth?
import java.applet.Applet;
import java.awt.*;
public class DokutelaDom extends Applet{
TextField numberField;
public void paint(Graphics g) {
g.drawString("Astonishing medical app",40,20);
numberField = new TextField();
numberField.setVisible(true);
g.drawLine(40, 70, 600, 70);
g.drawString("Patients, please enter your patient number below", 40,100);
numberField.setLocation(40, 2000);
numberField.setText("9876");
numberField.setSize(100, 40);
numberField.setVisible(true);
}
public static void main(String[] args) {
System.out.println("Dokutela Dom");
}
}
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
add(numberField);
Then it prints hundreds of new txt fields racing along the screen
Thanks