SealedObjects and unsealing them

Hi there

I am busy coding the section of my program that will store the user's username and password in a SealedObject.

The original object is called UserDetails and has two Strings. One for username and the other for password. They are both just Strings - no special encoding or anything.

When I seal the object to a file and then unseal it again, the username come out the same as what I entered with no problems. When the password comes out, it appears with garbled characters.

I don't understand why this is happening as it is just two Strings.

Any help would be greatly appreciated.

Many kind regards,

Rachel

[665 byte] By [RachelSwailesa] at [2007-10-1 0:05:22]
# 1

More info:

When I posted this, the username was collected in a JTextField and the password was in a JPasswordField.

It seems now that the situation mentioned above happens for JPasswordField.

So to sum up what is happening:

UserDetail ud = new userDetail(usernameField.getText(), passwordField.getPassword());

System.out.println(passwordField.getPassword()); //prints "turnip"

//Seal the object and save it,

//close the screen

//load the screen that reads from the object

//here the password that gets loaded is garbled.

Thanks again

Rachel

RachelSwailesa at 2007-7-7 15:49:28 > top of Java-index,Administration Tools,Sun Connection...
# 2
Sorry, the problem was solved when I realised that with not having used a JPasswordField in a ling time that .getPassword is char array.Many thanks anywayRachel
RachelSwailesa at 2007-7-7 15:49:28 > top of Java-index,Administration Tools,Sun Connection...