if you want to get the data back as a Jlist object itself, it is better to use object serialization.
ObjectOutput ObjOut = new ObjectOutputStream (new FileOutputStream (f));
else, if you want the data to be extracted in text format, follow the instructions given by others.
maybe tis code will help
public static void main(String[] args) throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String filename = "playlist.dat"; File f = new File(filename); try{ ObjectOutput ObjOut = new ObjectOutputStream(new FileOutputStream(f)); ObjOut.writeObject(
source share