I want to know if it is possible to put a save option on a JOptionPane dialog? If not how can I let the program save the results. I am using GUI.
Printable View
I want to know if it is possible to put a save option on a JOptionPane dialog? If not how can I let the program save the results. I am using GUI.
I haven't tried anything yet, because I know nothing about saving...What do you think?
Thanx but that will take long and I do not have that much time as the program is due tomorrow. It is not a must to have a save option but I really want to put it in. Is there not code that you can give me please??
Begging for code won't get you far. Show us your attempt, and ask a specific question (or questions), this isn't rent a coder :D.
HAHAHA I am open for learning but I don't have any information on how to do this, not even in the textbook that we got at school! So this is why I came here: To get information on the subject. I want to know if it is even possible to have a save option in a JOptionPae Dialog, in other words I want to know if you can save the text on the Dialog, before I just jump in it and not get anything right. I am merely doing research...:)
Checkout KevinWorkman's link from above and this one:
JOptionPane (Java Platform SE 6)
You can stick whatever buttons you want on a JOptionPane.
It's what you do with the users choice that you'll have to code.
So yes, you can have a button called "Save", but to actually save whatever it is you want to save to a file (or wherever) is something you'll have to code.
There's already a link above to the Basic IO tutorial, so that's a good place to start.
As for form, well the format of the save file is entirely up to you. You haven't actually said anything about what you want to save, you know.
I attached my main program...Under the Bereklone button is where the information comes together that I want to save. It is not completely finished. The program is a sort of a calculator so its numbers that I want to save...Any advice?? Oh no sorry I didn't put it in...How do I put code in?
If you want to provide code, you should post it as an SSCCE using the code tags and ask a specific question.
You can find some helpful links on Fubarable 's AboutMe page:
Java Forums - View Profile: Fubarable