the imports needed:
import java.util.logging.Logger;
import java.util.logging.Level;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
the code that write the file:
protected void kiirFajlba(List list, String fn) throws IOException {
try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(fn))) {
oos.writeObject(list);
} catch (FileNotFoundException ex) {
Logger.getLogger(Asztal.class.getName()).log(Level.SEVERE, null, ex);
}
}
and the method that gives the datas:
private void italokFajlban() throws IOException {
this.kiirFajlba(italok, "italok.bin");
}
italok here is an arayylist. quaston is this is good and if yes how i can reed in it gui. Thanks
that i show before, the big question is gui reading here.
New contributor
user25080506 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.