Main » Articles » Computer Science » 2014

Continue Fast Food Cash Register
[Optional] How to write text into a LOG file
 import java.io.*; // at top of program
 
 .
 .
 .
 
 private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
 
 try
 {
 PrintWriter info = new PrintWriter(
 new FileWriter("//home/davemulkey/food.txt",true) );
 for(int x=0; x < list1.getItemCount(); x = x+1 )
 {
 info.println(list1.getItem(x));
 }
 info.println("-------------");
 info.close();
 }
 catch(Exception ex)
 { System.out.println("error = " + ex.toString()); }
 }
Category: 2014 | Added by: Jerry (10/10/2011)
Views: 276 | Rating: 0.0/0
Total comments: 0
Only registered users can add comments.
[ Registration | Login ]
Section categories
2014 [20]
2013 [57]
Statistics
Map
Login form