public class Welcome extends JFrame {
private Toolkit toolkit;
private static String passy = "123456";
public Welcome()
{
setSize(300,550);
setTitle("Welcome");
setDefaultCloseOperation(EXIT_ON_CLOSE);
JPanel panel = new JPanel();
getContentPane().add(panel);
panel.setLayout(null);
JLabel label = new JLabel("Enter Password");
JPasswordField password = new JPasswordField(6);
password.setEchoChar('*');
password.addActionListener(new AL());
label.setBounds(0,0,300,25);
password.setBounds(100,0,200,25);
JButton b1 = new JButton("1");
b1.setBounds(0,100,100,100);
b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
"CONFUSED.COM"
}});
panel.add(b1);
panel.add(password);
panel.add(label);
panel.add(b1);
setVisible(true);
}
Basically, when i click the JButton b1 (1) i want the digit to appear in the password field box, but i dont know the action event to do this!
any help is much appreciated!
Thanks
jaredleo999