JPasswordField not working properly in JTable

387 Views Asked by At

I'm using JPasswordField as JTable cell editor in a column. It works fine while entering text; but after moving the cursor to another cell, it displays simple text.

So what can I do to keep text hidden while moving in other cells? Thanks in advance.

1

There are 1 best solutions below

0
On

The table uses a different component for the editor vs the regular cell renderer. You need a custom TableCellEditor that contains a JPasswordField.