Results 1 to 5 of 5
Thread: the save button
- 02-08-2012, 07:20 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 12
- Rep Power
- 0
- 02-08-2012, 07:25 PM #2
Re: the save button
Are you trying to write the text to a text file? Are you trying to use persistence of some kind? Serialization? What have you tried so far? Where are you stuck?
Last edited by KevinWorkman; 02-08-2012 at 08:09 PM.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
-
Re: the save button
Moving to the Swing forum -- nothing "advanced" about this question.
I second Kevin's comments: you need to tell us a lot more about your problem and exactly where you're stuck if we're going to have a chance of being able to help you.
- 02-09-2012, 12:57 PM #4
Member
- Join Date
- Jul 2011
- Posts
- 12
- Rep Power
- 0
Re: the save button

I made this counter programme , that every time I press the counter button it will increase the number on the text field.
and I want to put a save button to work like this:
for example on the programm above I reached number 8 if I press the save button it should save number 8 on the text field.
and if I closed the programm and then open it again I should see number 8 on the text field.
here is my code :
PHP Code:counterButton.addActionListener(new Test()); saveButton.addActionListener(new Test()); } private class Test implements ActionListener { public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if (o.equals(counterButton)) { ButtonClicks ++; } else { if (o.equals(saveButton)) { ?????????????????? } } lapel.setText("" + ButtonClicks ); } }
what should I write instead of the question mark to make the save button work.Last edited by agater; 02-09-2012 at 01:00 PM.
-
Re: the save button
Then you have a couple of choices: easiest is to simply write it to a text file and read in the file on program start up. You also can use Properties which are also fairly easy to use.
Similar Threads
-
How can i save the data Internally(auto save)
By Rama Koti Reddy in forum AWT / SwingReplies: 2Last Post: 11-01-2010, 08:31 PM -
Save button not working
By twinytwo in forum AWT / SwingReplies: 3Last Post: 03-28-2009, 12:05 AM -
Can some one tell me why the save button dosnt work... its wrecking my head
By twinytwo in forum New To JavaReplies: 2Last Post: 03-26-2009, 04:15 AM -
Save button not working ,,,,,
By twinytwo in forum AWT / SwingReplies: 3Last Post: 03-25-2009, 08:22 PM -
Disable Save button - Acrobar Reader
By Deepa in forum New To JavaReplies: 1Last Post: 03-06-2009, 12:15 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks