Skip to main content

How to add jpassword field in Jtable(only one cell)

1 reply [Last post]
Anonymous

If I use the following code. the password field is applied for all columns. But I need password field in only one cell.

Code :
--------
JPasswordField password = new JPasswordField();
password.setBorder(new LineBorder(Color.BLACK));
TableCellEditor editor = new DefaultCellEditor(password);
table.getColumnModel().getColumn(1).setCellEditor(editor);

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
walterln
Offline
Joined: 2007-04-17

Override JTable#getCellEditor(int row, int column).