Commit afd9f837 authored by 9831111's avatar 9831111 🙂

Add signUpUser method.

parent 178d1ccf
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_9" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
......@@ -8,5 +8,4 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
</module>
\ No newline at end of file
......@@ -65,5 +65,18 @@ public class LoginFrame extends JFrame {
}
public void signUpUser(File accounts) {
try (FileWriter fileWriter = new FileWriter(accounts, true)) {
fileWriter.write(userName.getText() + " " + passwordField.getText() + " " + remindMe.isSelected() + " 0 0 0 0 0 " + "\n");
JFrame signUpMessage = new JFrame();
ImageIcon icon = new ImageIcon("pictures/logo.png");
JOptionPane.showMessageDialog(signUpMessage, "Successfully registered.", "", JOptionPane.INFORMATION_MESSAGE, icon);
} catch (Exception ex) {
System.out.println("No account found ! ");
ex.printStackTrace();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment