0
/*********************Pay Button Listener***************************************/
	public class payListener implements ActionListener{
		public void actionPerformed(ActionEvent e) {
			
			
			String fileName2 = "Ticket/"+ticketIDNumber+".dat";
			File ticket2 = new File(fileName2);
			if(ticket2.exists()){
				try{
					FileReader fileReader = new FileReader(fileName2);
					BufferedReader bufferedReader = new BufferedReader(fileReader);
					bufferedReader.readLine(); //OMIT Entrance Time 
					
					FileWriter fw = new FileWriter(fileName2);
					BufferedWriter bufferedWriter = new BufferedWriter(fw);
					//fw.write("Hello");
				
					bufferedReader.close();
					fileReader.close();
					fw.close();
				}
				catch(IOException f){
					System.out.println("Error in Setting Payment Time for ticket");
				}		
			}
			
			}
		}
	
	
	/*********************Pay Button Listener***************************************/

Someone please show me how to replace content in file, only the 2nd line please. current file looks like this:

1324254875443
1313131
Paid
0.0

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by 03hasnam
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.