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.
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
Re: needing a little assistance
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.
Re: needing a little assistance
Quote:
Originally Posted by
twistedmike
what i want to do is to make the code that i have saved to a .properties file.
:confused: 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.