/*PROG 23.3 DEMO OF JTEXTFIELD AND JPASSWORDFIELD */
import java.awt.*;
import javax.swing.*;
public class Jtext1 extends JApplet
{
JTextField name;
JPasswordField pass;
JLabel Lname, Lpass;
public void init()
{
Container contentPane = getContentPane();
contentPane.setLayout(new FlowLayout());
Lname = new JLabel(“Enter your name”);
Lpass = new JLabel(“Enter your password”);
name = new JTextField(15);
pass = new JPasswordField(15);
pass.setEchoChar(‘+’);
contentPane.add(Lname);
contentPane.add(name);
contentPane.add(Lpass);
contentPane.add(pass);
}
} ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.