how to add JPassword field to a JTable

Discussion in 'Java' started by kavitha2007, Jan 4, 2007.

  1. kavitha2007

    kavitha2007 New Member

    Joined:
    Jan 4, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    48
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    Example:
    Code:
    		JPasswordField password = new JPasswordField();
    		password.setBorder( new LineBorder(Color.BLACK) );
    		TableCellEditor editor = new DefaultCellEditor( password );
    		table.getColumnModel().getColumn(1).setCellEditor( editor );
    
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice