CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2008
    Posts
    27

    needing a little assistance

    i am just starting to learn Java and i am starting by making my own private password storage app.
    but i am having a little problem. i have wrote some simple code but i want to save input into a properties file. here is what i have.
    Code:
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.util.*;
    import java.io.*;
    
    import javax.swing.Box;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPasswordField;
    import javax.swing.JTextField;
    
    public class PasswordField {
      public static void main(String args[]) {
        JFrame f = new JFrame("Accounts");
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = f.getContentPane();
        content.setLayout(new BorderLayout());
        Box rowOne = Box.createHorizontalBox();
        rowOne.add(new JLabel("Username"));
        rowOne.add(new JTextField());
        Box rowTwo = Box.createHorizontalBox();
        rowTwo.add(new JLabel("Password"));
        rowTwo.add(new JPasswordField());
        content.add(rowOne, BorderLayout.NORTH);
        content.add(rowTwo, BorderLayout.SOUTH);
        f.setSize(300, 200);
        f.setVisible(true);
      }
    }
    i still need to add another text field and lastly encrypt the properties file but that will come later.

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: needing a little assistance

    So what is your question? (note: specific questions get more specific answers than general or vague questions).

    Questions are the important thing, answers are less important. Learning to ask a good question is the heart of intelligence...
    R. Schank
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  3. #3
    Join Date
    Jul 2005
    Location
    Currently in Mexico City
    Posts
    568

    Re: needing a little assistance

    Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?

    I had a nightmare last night. I was dreaming that I’m 64-bit and my blanket is 32-bit and I couldn’t cover myself with it, so I’ve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S (from: bash.org.ru)

    //always looking for job opportunities in AU/NZ/US/CA/Europe :P
    willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL"));

    USE [code] TAGS! Read this FAQ if you are new here. If this post was helpful, please rate it!

  4. #4
    Join Date
    Dec 2008
    Posts
    27

    Re: needing a little assistance

    ok well sorry for the confusion what i want to do is to make the code that i have saved to a .properties file.

  5. #5
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: needing a little assistance

    Quote Originally Posted by twistedmike View Post
    what i want to do is to make the code that i have saved to a .properties file.
    Nope, doesn't make sense to me. Can you explain more clearly what you mean?

    If you want to learn how to use properties, see Properties. This might also be helpful: Properties Files for Resource Bundles.

    When a programming language is created that allows programmers to program in simple English, it will be discovered that programmers cannot speak English...
    Anon.
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured