I have JTable object which contains 2 columns (name and value). I want to create a table like below.
JTable only allows adding an Object as a row. Now how do I mask the values of the password only such that it does not appear and on the user keyed value is also stored in the tablemodel.
Use a cell renderer which does that. I think that having it return a JPasswordField would work. You didn't say whether the table was editable, but if it is then you're going to have to do the same with your cell editor.
(I'm guessing you have never heard of those things, based on the incorrect things you said about JTable in your post. I would suggest going through Oracle's JTable tutorial starting from the beginning and continuing until you get to the part where cell renderers and editors are covered.)