Home > Default > Strange behaviour of JPasswordField!!!!

Strange behaviour of JPasswordField!!!!

November 30Hits:0
Advertisement
Hi,
In JTable i need to show one column as password field,
For that I wrote the following code.
for(int i = 0; i < colNames.length; i++){
if(i == 2){
     DefaultCellEditor dce = new DefaultCellEditor (new JPasswordField(20));          
table.getColumn(colNames).setCellEditor(dce);     
else{
DefaultCellEditor dce = new DefaultCellEditor(new JTextField(20));          
table.getColumn(colNames[i]).setCellEditor(dce);     
While keying in it is showing * only,
as soon as I click on save to save the record, immediately this password field is showing the actual text.
Can anyone tell me what is the reason for this behaviour??
Regards,
SRAO          

Answers

hi,
it's no use registering a table cell editor if you let the password be displayed by the default table cell renderer - the latter will draw it as ordinary text. so apply a custom table cell renderer, too.
sincerely, Michael

Read other 2 answers

Tags:

Related Articles

  • Strange behaviour of JPasswordField!!!!November 30

    Hi, In JTable i need to show one column as password field, For that I wrote the following code. for(int i = 0; i < colNames.length; i++){ if(i == 2){      DefaultCellEditor dce = new DefaultCellEditor (new JPasswordField(20));           table.getColu

  • APEX Listener and EPG - strange behaviourOctober 11

    Hi For some years, I've used EPG for APEX but have struggled with performance particularly as I can have up to 150 student developers using at any one time. I do a fair amount of work using ORDImage and have successfully developed APEX applications t

  • Strange behaviour of Runtime.getRuntime().exec(command)October 11

    hello guys, i wrote a program which executes some commands in commandline (actually tried multiple stuff.) what did i try? open "cmd.exe" manually (administrator) type "echo %PROCESSOR_ARCHITECTURE%" and hit enter, which returns me &qu

  • Report S_ALR_87013542 strange behaviourOctober 11

    Hi All, Report S_ALR_87013542 - Actual/Comm/Total/Plan in COAr crcy -  is showing up cross signs in some of the columns.When the cross sign (like any other column value) is clicked the line item detail are sown correctly. Has anybody encountered this

  • View Master mode strange behaviour with jpg filesOctober 11

    Hy all, I'm using Aperture, and I'm tweakin a lot the SW to discover all secrets .... I'm really concerned about a strange behaviour of the SW in view mode. If I open a jpg file, do not apply ANY modification, and apply the "show master" command

  • Strange behaviour: two servers on the same portOctober 11

    Hi! I hope this is the right section for this post. I need help about a strange behaviour involving a ServerSocket. For my thesis I need to write a program that receives data from a pre-existing DSMS client, filters them and then sends them to a pre-

  • Cursor shows strange behaviour in 10.9.5October 11

    HI, I'm using a 15" MBPr late 2013, i7, 16 GB RAM, 1 TB SSD, running on 10.9.5. Lately I registered a very strange behaviour of the cursor when using the built in trackpad. If hovering over one of the symbols in the bar at the upper right corner of t

  • Windows 8.1 Enterprise Evaluation- Strange behaviour of network adapterOctober 11

    Hello there are discussions and questions around this community about network adapter dropping connection while system is running. But I have found unique problem with my network adapter driver. I have tried to state my problem as clearly as possible

  • Strange behaviour from new 2012R2 in old domainOctober 11

    Hi all, At work (education level), I'm starting to take charge of windows admin, so beiing a noob admin I'm finding strange behaviours that I hope you can help me solve them all :-) We've one (big) domain with about 5000 computers (workers and studen

  • Strange behaviour in MailOctober 11

    I have ongoing strange behaviour with Mail in Mountain Lion on a MacBook Pro. As well as randomly and intermitttently dropping connections to my various mail servers, I also, randomly and intermittently, fail to get to Print, or to create a new Mailb

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.455 s.