import java.awt.*;
import java.awt.event.*;
import java.text.*;
import javax.swing.*;
public class MiMa
{
public static void main(String args[])
{
MiFrame frame=new MiFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
class MiFrame extends JFrame implements ActionListener
{
JLabel T1,T2;
JTextField A2,A4;
JPasswordField A1;
JButton B;
MiFrame()
{
setTitle("Mi ma");
A4=new JTextField("123456");
Container con=getContentPane();
//con.setLayout(new BorderLayout());
T1=new JLabel("pass");
con.add(T1);
T2=new JLabel("password");
A1=new JPasswordField(6);
A1.setEchoChar('*');
con.add(A1);
con.add(T2);
A2=new JTextField(" ");
con.add(A2);
B=new JButton("");
B.addActionListener(this);
setSize(120,120);
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==B)
{
A2.setText("password");
}
else
{
A2.setText("pass");
}
}
}