|
-
March 8th, 2010, 03:47 PM
#1
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.
-
March 9th, 2010, 06:40 AM
#2
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.
-
March 9th, 2010, 05:13 PM
#3
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!
-
March 9th, 2010, 10:33 PM
#4
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.
-
March 10th, 2010, 06:06 AM
#5
Re: needing a little assistance
 Originally Posted by twistedmike
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|