Results 1 to 7 of 7
- 08-09-2011, 06:44 AM #1
How To Store Variables In A Text File That Aren't Constant
Hello, I am trying to write a program that will generate a random password then allow you to save it out to an encrypted database. While I was trying to create this though I ran into a problem. I needed to get input from a textfield and store it into a file. When I tried to do this though it would get errors, but I wouldn't get errors if I stored a variable like {String a = "hi";}
My Code:
All help is appreciated and just if anyone is wondering I did search google for an answer, but found no answer.Java Code:File somefile = new File("Passwords.txt"); BufferedWriter output = new BufferedWriter(new FileWriter(somefile)); output.write(te.getText()); output.close();
- 08-09-2011, 06:49 AM #2
Once again we don't read minds. If you get any errors then post the exact and full error message.
- 08-09-2011, 06:52 AM #3
- 08-09-2011, 06:58 AM #4
Of course we need to see the errors. How the heck are we supposed to diagnose your problem if we cannot see the errors?
- 08-09-2011, 07:01 AM #5
To you, maybeYou don't need to see the errors anyway they weren't helpful
What?they just lead me to a new window.
db
- 08-10-2011, 11:13 PM #6
Alright here are the errors:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Passave$event.actionPerformed(Passave.java:47)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:2028)
at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2351)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.jav a:6373)
at javax.swing.JComponent.processMouseEvent(JComponen t.java:3267)
at java.awt.Component.processEvent(Component.java:613 8)
at java.awt.Container.processEvent(Container.java:208 5)
at java.awt.Component.dispatchEventImpl(Component.jav a:4735)
at java.awt.Container.dispatchEventImpl(Container.jav a:2143)
at java.awt.Component.dispatchEvent(Component.java:45 65)
at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4621)
at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4282)
at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4212)
at java.awt.Container.dispatchEventImpl(Container.jav a:2129)
at java.awt.Window.dispatchEventImpl(Window.java:2478 )
at java.awt.Component.dispatchEvent(Component.java:45 65)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.j ava:679)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectio nPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectio nPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:652)
at java.awt.EventQueue$2.run(EventQueue.java:650)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectio nPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 649)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:122)
- 08-10-2011, 11:56 PM #7
Similar Threads
-
Constant Variables
By harshakantha in forum New To JavaReplies: 3Last Post: 06-13-2011, 07:51 AM -
constant variables questions
By sgthale in forum New To JavaReplies: 3Last Post: 05-06-2011, 05:34 AM -
Store links in text file and read into variables
By africanhacker in forum New To JavaReplies: 1Last Post: 03-31-2011, 05:18 PM -
How to store 5 numbers from a file into 5 seperate variables?
By kewlgeye in forum New To JavaReplies: 4Last Post: 06-09-2008, 04:44 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks