[Java Release with Source] Account Info Saver

09/12/2008 10:04 Ian*#1
Hey everyone, I made a little quick program in java (It's my first one besides hello world)

Anyways, basically what this does is save an account in your Conquer(Only if it's C:\Program Files\Conquer 2.0\) folder in a file called whatever you made your LoginID.

Edit: Figured it out. Updated Attatchments

I've included the source code just as a little reference for people that are learning Java like myself.

sharing is caring.

--Note to people who want to just use this.
You need to have java runtime installed, please go to java.com to get it.
09/14/2008 13:30 AboDawod#2
Thank you
09/20/2008 16:18 ~Yuki~#3
Who need this is lazy or dumb:P
09/25/2008 22:23 Ian*#4
Quote:
Originally Posted by lolmaster123 View Post
Who need this is lazy or dumb:P
It was more/ less just for me to test reading and writing data. But yeh, it helps keep things more organized. It's not for lazy or dumb people, these are actually smart to use, there's quite a few floating around this site, but I just gave the source to this one.
10/01/2008 01:58 mrbasharking#5
LOL, I know many archers crying to get such program for their water factory
10/01/2008 05:34 `xEnt#6
Since your still learning Java i better steer you in the right direction.

Quote:
Originally Posted by Force.Of.Spite
private void WriteToFile(String s) {
try {
BufferedWriter f = new BufferedWriter(new FileWriter("C:Program FilesConquer 2.0"+jTextField1.getText()+".txt"));
f.write("LoginID: "+jTextField1.getText());
f.newLine();
f.write("Password: "+jTextField2.getText());
f.newLine();
f.write("ID#: "+jTextField3.getText());
f.newLine();
f.write("Question: "+jTextField4.getText());
f.newLine();
f.write("Answer: "+jTextField5.getText());
f.newLine();
f.write("Email: "+jTextField6.getText());
f.newLine();
f.newLine();
f.write("Created by Force.Of.Spite");
f.flush();
f.close();
} catch (IOException e) {
}
}


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
{
StringBuffer sb = new StringBuffer();
sb.append("LoginID: "+jTextField1.getText()+"n");
sb.append("Password: "+jTextField2.getText()+"n");
sb.append("ID#: "+jTextField3.getText()+"n");
sb.append("Question: "+jTextField4.getText()+"n");
sb.append("Answer: "+jTextField5.getText()+"n");
sb.append("Email: "+jTextField5.getText());
WriteToFile();

}
Whats with all the stuff in jButton1ActionPerformed? its unneeded, should be like this

Since your still learning Java i better steer you in the right direction.
Code:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    {
       WriteToFile();  
    }
and remove the arguments on the WriteToFile method, as they are not even used.

I see you used something like JFormDesigner to create the GUI, also when using try/catch just use Exception instead of IOException, as it handles all/most types of exceptions.

Try out System.getProperty("line.seperator") too, faster than newLine()

Other than that not bad, try not to rely on a GUI too much, if you have to just do a command line program with some IO from the javax.swing.JOptionPane, static and easy to use.
11/09/2008 20:17 Ian*#7
I used netbeans to make it, I've never even used the console. I'm not really even coding anymore, too busy for it. Sometimes I still open up Delphi and just make programs to make things easier for myself, i.e the reason i made this acct info saver.
I made something not that long ago that made it easy for me to get steam accounts.
It was called SteamChat( :) ). When they tried to login to the chat app, it would display a message (after a delay of 3000 ms) that said, Failed to connect to steam servers, then sent me their login info and would kill steam's process, and their iexplorer/ firefox everytime they opened(Until restart anyways).