Campbell Ritchie wrote:Welcome to the Ranch
That GUI code shouldnot write anything to a file. You sh6ld have a separate class which does the reading and writing. I presume you are familiar with the general IO capabilities of Java®. Can you write code which does the writing separately from the GUI? Start with that and show us it, then consider how to control such code from the GUI.
Don't make the GUI classes into action listeners. Don't use == on Strings (but that is probably not the real problem).
Liutauras Vilda wrote:Apart from the GUI part, I'm totally puzzled what you are trying to achieve. Please explain in simple words what the app is supposed to do. Please don't mention any technical terminology how you're going to do.
So you'll need I think to get text from the cells and write them to file.Gregor Kunc wrote:When I fill table or put some data (look attachment for table) then I want this to save to file and read it.
Liutauras Vilda wrote:
So you'll need I think to get text from the cells and write them to file.Gregor Kunc wrote:When I fill table or put some data (look attachment for table) then I want this to save to file and read it.
Campbell suggested I see already to go through tutorial and learn how to write data to the file. Have you checked it?
To get text from the cell I think is the easier part.
Liutauras Vilda wrote:Is it going to be a text file?
Consider what kind of delimiter you want to use to delimit data written to file. What formatting?
Create some dummy String "vienas du trys keturi penki sesi septyni astuoni devyni desimt" and try to pass it to method and write to a file in the way you want it.
Campbell Ritchie wrote:I have just suggested he start at the other end of the process. My post is better because it mentions beer
It doesn't really matter which part you do first, but only do one part at a time, otherwise you will become all confused. If you get the details from text fields first, you can start by using System.out.println to show what the text you have read is.
Campbell Ritchie wrote:Do you need any if‑elses? We believe you will learn better if you find out the information for yourself, so we do all we can to avoid simply giving out solutions. How far have you got with it?
I've never won anything before. Not even a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|