//Purpose: This applet simply creates a text field component import java.awt.*; import java.applet.*; import java.awt.event.*; public class test12f extends Applet{ //Set background to yellow, public void init() { setBackground(Color.yellow); setFont(new Font("Helvetical", Font.BOLD, 12)); setLayout( new GridLayout(2,2)); add(new Label("Enter your Color Choice")); TextField color = new TextField(20); //maximum of 20 characters add(color); add(new Label("Password")); TextField password = new TextField(40); //maximum of 40 characters password.setEchoChar('*'); //echos this character add(password); } //Paint the current key at the current position public void paint(Graphics g) { //set drawing color g.setColor(Color.red); } }