This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
first read complete java file in to a string and then by using conditions get the position where you want to write the data. write the data at that position and write the modified string in to the file.
Please TellTheDetails (← click) just saying it doesn't work doesn't make it easy for anyone to help you. Please explain what you have tried, what you expected to happen, what actually happened and post a SSCCE .