how to add JPassword field to a JTable

Newbie Member
4Jan2007,11:35   #1
kavitha2007's Avatar
How to add a Jpassword field in a JTable

My application requires the need for the creation of a new user.
So the new user window appears in a jtable ,having the columns as user name and password.so my doubt is how to add Jpassword field to the JTable.
Team Leader
4Jan2007,14:13   #2
pradeep's Avatar
Example:
Code: Java
JPasswordField password = new JPasswordField();
        password.setBorder( new LineBorder(Color.BLACK) );
        TableCellEditor editor = new DefaultCellEditor( password );
        table.getColumnModel().getColumn(1).setCellEditor( editor );