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

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

Similar Messages

  • Trying to drag pdf files i have and combine them into one pdf file in the account i just purchased with Adobe. when i drag a pdf file over Adobe doesn't accept it. says it can not convert this type of file. but it is an Adobe file. Do I need to change it?

    Trying to drag pdf files i have and combine them into one pdf file in the account i just purchased with Adobe. when i drag a pdf file over Adobe doesn't accept it. says it can not convert this type of file. but it is an Adobe file. Do I need to change it in some other form befor dragging it?

    Hello djensen1x,
    Could you please let me know what version of Acrobat are you using.
    Also, tell me your workflow of combining those PDF files?
    Please share the screenshot of the error message that you get.
    Hope to get your response.
    Regards,
    Anubha

  • How can I take 3 devices off of my email account and give them their own account. We are sharing storage and need to each have our own account.

    Everyone in my family has an iPhone or iPad and they are all on one email account. How do I take them off and give them their own accounts so I can have my storage back?

    Have them delete the iCloud account (your email address) on their devices then let them create their own iCloud account -> http://support.apple.com/kb/ht4436.  If all of you are syncing contacts and calendars on the same iCloud account, they have to re-organise those stuffs once they have their own iCloud account.  When you delete an iCloud account, it normally asks what would you do for the synced information - keep it on the iOS device or delete.  If they choose to keep the synced information (e.g. Contacts and Calendars), they have to delete those thare aren't theirs or they can start from scratch by deleting the synced information from the iOS device.  Hope this helps.  Cheers!

  • In Pages 5, Maverick, How do I stop automatic conversation of URLs to hyperlinks and seeing them underlined

    There used to be a preference setting in Pages.  Now it seems gone in Pages 5.   So how do I stop automatic conversation of URLs to hyperlinks and seeing them underlined in text.  Sometimes I want it, but not always.

    The preference setting to turn off links is gone. When you enter content that triggers link detection, a link character style gets applied. Right-click on the link, choose Edit Link from the menu, and then Remove.
    To prevent Pages from automatically detecting links, visit Edit > Substitutions > and deselect Smart Links.

  • In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

    In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

    Sorry, I tried to say your answer solved my question, but I guess I told it that my response to you solved it. Now that I liked it, the solved option doesn't appear.

  • Good morning, i would like to know how to take pictures from iphoto and put them in a folder on desktop

    Good morning: would like to know how to take pictures from my iphoto and put them in a folder on my desktop

    To take photos from iPhoto and put them onto a folder on Desktop, first create a folder on Desktop. Right-click on Desktop and create a new folder.
    Then, open iPhoto, and you have two ways to export photos:
    1. Select the photos you want to copy to Desktop with Command key (or go to Edit menu > Select All, if you want to copy all photos), and then, drag them to the folder on Desktop.
    2. Select the photos you want to copy to Desktop with Command key, go to File menu > Export, and follow the steps.
    You can choose the one you prefer

  • Does anybody know how to get a valid email address for Apple service?  I am unable to call them during business hours and paid them over $200 a month ago to have a repair done ot my iPhone.  I have heard nothing.  They are usually good, but this time....

    I have looked all over the Apple Store website but there is no obvious email address.   I have tried to post feedback and 'follow my repair online' but the are not responding.  Thanks anybody who can advise an email address.

    Sorry, but Apple does not provide technical support via email, so they have no published email addresses. You will need to find a way to call them. Or make an appointment with the Genius Bar at an Apple Store, if there are any near you, and have them follow up.
    Regards.

  • A better way to differentiate positive vs. negative numbers and sum them ?

    Hi, I wonder if there is a better or easier way to differentiate the positive numbers from negative ones and sum them respectively?
    I come up with below:
    create table t1 (num number, id varchar2(3));
    insert into t1 values  (-100, 1);
    insert into t1 values (50, 2);
    insert into t1 values  (-10, 3);
    insert into t1 values  (-20, 4);
    insert into t1 values  (50, 5);
    insert into t1 values  (60, 6);
    select sum(decode(sign(num), 1, num, 0)) plus, sum(decode (sign(num), -1, num, 0)) minu from t1;
    PLUS   MINU
    160     -130Any suggestion would be appreciated! Thanks

    if there is a better or easier way to differentiate the positive numbers from negative ones and sum them respectively?Maybe you want them in different rows than in different columns:
    SQL> select sign(num), sum(num) from t1 group by sign(num)
    SIGN(NUM)   SUM(NUM)
             1        160
            -1       -130
    2 rows selected.?

  • When I put in my earphones to listen to music the sound isn't clear and I have to push and hold them in it in order for it to be. It's not the earphones because I use them in my laptop and they work fine. Is there a way to fix this problem?

    Whenever I put my earphones into my iPod Touch 2g the music isn't clear and I have to push and hold them in order to hear the song normally. It isn't the earphones because I tried another pair, that worked fine, and there was still no difference. I also use the same pair of earphones in my laptop and it sounds great. Is there a way to fix this problem without having to buy a brand new iPod touch? Do I need to clean it or something? And if so, how would I go about doing that? Thanks!

    - Try cleaning out/blowing out the headphone jack. Try inserting/removing the plug a dozen times or so.
    If still problem that indicates you have a bad headphone jack.
    Apple will exchange your iPod for a refurbished one for this price. They do not fix yours. Likely not worth it for your old 2G iPod
    Apple - iPod Repair price                  
    A third-party place like the following will replace the jack for less. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens
    Replace the jack yourself
    iPod Touch Repair – iFixit

  • How do I get the pictures folders in photoshop 7 out of My window XP computer and put them into my new computer windows 8 photoshop12

    How do I get the pictures folders in photoshop 7 out of My window XP computer and put them into my new computer windows 8 photoshop12

    I am so sorry for you and your situation. Were you using iCloud photostream?
    Otherwise I do not see any chance for your precious photos.
    Congrats anyway on the little darling!

  • Get All images from a website and put them in a listbox.

    Hi Everyone, I am new to Java Programming.
    I wanted to know if there is a way to get all the images in a website and put them in a listbox. And if an item is clicked in list box, view it in a picturebox.

    Harsimran_Singh wrote:
    what is the whole idea about .Net vs. Java...guys, .NET users are so friendly and helpful, they don't even judge english
    This is not putting a good impression of Java Users on me.good luck with .net. im sorry that things didnt work out with java.
    unfortunately, .net is essentially a clone of java so you may find that you will be looking
    to learn exactly the same things but for an expensive propriety platform.
    if you change your mind, read:
    [swing tutorials|http://java.sun.com/docs/books/tutorial/uiswing/]
    jlist
    listcellrenderer
    [list tutorial|http://java.sun.com/docs/books/tutorial/uiswing/components/list.html]
    [advanced list programming|http://java.sun.com/products/jfc/tsc/tech_topics/jlist_1/jlist.html]
    on your way out thank the moderators : )

  • Get Javascript values and use them in a servlet?

    Hey
    I have a HTML which has Javascript scripts which I have to get values from (a array to be exact) and pass them to a servlet so I can process the information in a certain way. I cant seem to find a way to do this properly as the servlet is server side and Javascript is client side. How can I implement this?
    Using a quick example example I have
    C:/index.html
    C:/js/script.js
    Index.html contains:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <script type="text/javascript" src="js/script.js">
    </script>
    </head>
    <body>
    a href="javascript:void(0);" id="add"><img src="images/menunew.png" alt="plus" border="0" />
    /a>
    </body>
    </html>
    Script.js contains:
    var Script = Class.create({
    a:4,
    b:5,
    add: function(){       
    return (this.a + this.b);
    (Ignore syntaxis errors as this is a quick example I wrote up just to see if you can give me a practical example on how to read it.)
    How can from a Java servlet access a and b from the script.js file (which contains a class named Script) and also access the function add which returns that value?
    Thank you for the help
    Edited by: 902756 on 16-dic-2011 0:18

    DrClap wrote:
    902756 wrote:
    1: Yes, it seems like the logically answer but Im not too up on AJAX and even less on mixing it up with servlets. Do you mind giving me a simple add (function) sample or something similar?You are looking at it the wrong way. What you actually want to do is to have the browser send a request (which somehow contains that Javascript data) to a URL which causes the servlet to receive the data. There's no "mixing it up" going on there. The client and the server are entirely separate.
    And since that request would be an HTTP request, it's just text. There's no concept in HTTP of transmitting objects, whether they be Javascript objects or Java objects. Anything you want to transmit has to be converted into text by the sender and converted back into objects by the receiver.
    So there's no such thing as "a simple add function". You're going to have to stop thinking in that way and start thinking of client-server systems in the way they actually are.The thing is I want to start simple to grab a simple concept....
    Im trying a AJAX route and I have the following:
    /index.html
    /js/Adding.js
    Index contains:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
         <title></title>
         <script type="text/javascript" src="js/Adding.js"></script>
    </head>
    <body>
    <select name="num1">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    </select>
    <select name="num2">
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    </select>
    <form method="get" name="adding">
    Do
    <span id="res"></span>
    </form>
    </body>
    </html>
    Adding.js contains
    var Adding = Class.create({
    x: null,
    y: null,
    add: function()
         var xmlHttp = new XMLHttpRequest();
         var value1 = document.getElementById("num1").value;
    var value2 = document.getElementById("num2").value;
         xmlHttp.open("GET", "index.html", false);
         xmlHttp.send(value1 + value2);
         var result = document.getElementById("res");
         result.innerHTML = xmlHttp.responseText;
    This shows 2 comboboxes full of numbers and link saying "Do" which calls the javascript function and adds the two numbers in the comboboxs and shows them on the screen without refreshing the page. This does not work and I would like this to work before I continue onto the bigger picture.

  • Take out multiple values from a db and handle them in an applet.

    I have a db with tables. I want to take out several values from them and make them visible in a JFrame (or applet).
    I dont know how to do. I have an app that connects to the db and selects the values and puts the Strings in a Vector. But now then?
    I have looked at examples that retrieve Strings but not vectors, isn't that possible?

    Hi,
    On initialization of your frame you can loop over your vector and display them.
    Now the problem is in what type of component do you want to put your data.
    I can give you an example.
    What you can do is create a String which will contain all the data from
    your vector and set that string to the component.
    Example:
    Vector data;
    String result;
    for(int i=0; i < data.size(); i++) {
    result += (String)data.elementAt(i) + "\n";
    Now you need to put the string into a component which is easy done.
    Let take a textarea component.
    JTextArea txaTest = new JTextArea();
    txtTest.setText(result);
    Now all the data will be shown in the textarea component on your frame.

  • Getting values from a table and concatenate them

    Hi All,
    I think somebody out there should be able to help me.
    I have a list of contract numbers the user has to type in.
    I've created a table where user can add as many rows as needed. Each row is a contract number.
    Once completed, I have to concatenate all of the contract numbers, separated with commas, so that I can send them to a floating field within a text box.
    It should look like this.
    .....1234, 2345, 3456 and 5678 (assuming these four values were keyed in by the user in the table form)
    Anybody can help me explaining how to concatenate the values and put them into the floating field?
    Thanks in advance.
    Rafael

    You can concatinate them easily but getting them into a floating field on the same form will be an issue. The floating field can only be filled when th eform is rendered and data is placed on the form. Floating fields are not interactive...so after the data load they are turned into text....they are not even fields anymore.

  • I have an iPhone 4S, 16 GB. I'm trying to sync selected songs to my phone by clicking them and dragging them onto my device. Every song copied nicely onto there till I got up to 66. After that, I try to sync more and suddenly they won't show up on there.?

    I've already read some of these discussions and tried to resolve the issue by turning off my computer and phone, and turning them back on again, and the problem still remained. I couldn't sync more than 66 songs onto it. So I continued to look up more articles and quite a few said to restore my iPhone, and so I did. I restored with a recent backup and made sure I had the latest version of iTunes installed. And so after I cleared off my phone and restored it, I went to put those songs back onto there, and once again when I got up to 66 songs, it wouldn't let me put any more on there. So I thought that was enough and decided to sign up myself on here to ask a question to the community. Anyone who's willing to give me a good answer or more possible answers, please reply to this question ASAP! Please and thank you!

    Ok, sorry. And yes, I just restored my iPhone as new and tried to put all the songs on there before I even restored with my previous backup, but it still does the same thing... even when I just checked the option to sync only "selected music or videos". How's that possible?
    P.S. After I tried syncing with checked songs only, nothing showed up under Music on my phone and this message popped up in iTunes: "The iPhone "..." could not be synced because the sync session failed to finish." If you could, please tell me what that means, thanks.

Maybe you are looking for