Results 1 to 1 of 1
  1. #1
    xbox_nutter is offline Member
    Join Date
    Mar 2009
    Posts
    15
    Rep Power
    0

    Default hey everyone a quick buffered writter question

    I am writting an XML parser and am trying to add tabs to the .write() function of the buffered writter what is the best way of doing this?

    here is my code:

    Java Code:
    public void writeXML() {
    		try {
    			File fileToWrite = new File(
    					"C:\\Documents and Settings\\userName\\Desktop\\new_games.xml");
    			FileWriter fileWriter = new FileWriter(fileToWrite);
    			BufferedWriter writer = new BufferedWriter(fileWriter);
    			for (int i = 0; i < gameList.size(); i++) {
    				Game game = gameList.get(i);
    				writer.write("'<?xml version="+" 1.0'"+"' encoding="+"ISO-8859-1'"+"?> ");
    				writer.write("[COLOR="Red"]NEED TABS HERE !!<[/COLOR]gamelist>");
    				writer.write(game.getGameName());
    				writer.newLine();
    
    
    				writer.newLine();
    				writer.newLine();
    				writer.flush();
    			}
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    Last edited by xbox_nutter; 03-20-2009 at 11:49 AM.

Similar Threads

  1. One last quick question
    By jigglywiggly in forum New To Java
    Replies: 7
    Last Post: 01-26-2009, 08:53 AM
  2. Quick Question
    By Graeme in forum New To Java
    Replies: 4
    Last Post: 01-08-2009, 08:01 PM
  3. Quick Question
    By Spenc in forum New To Java
    Replies: 3
    Last Post: 09-22-2008, 02:26 PM
  4. Quick question about sorting
    By nbd223 in forum New To Java
    Replies: 10
    Last Post: 04-28-2008, 09:11 AM
  5. Quick Stupid Question
    By bluekswing in forum New To Java
    Replies: 7
    Last Post: 01-08-2008, 06:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •