Results 1 to 2 of 2
  1. #1
    lost_soul is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Default Looping question

    I've got a question about loops. I'm kind of confused on how to print things out on a different line. I want to display my objects one on top of the other but they print out horizontally. What is recommended to do this



    Java Code:
    	public void draw(Graphics page)
    	{				
    		page.setColor(color);
    		for (int f = 1; f <= numrows; f++)
    		{
    		for (int r = 1; r <= numsquares; r++)
    		{
    			draw(page);
    			setX(getX() + getLength());	
    			system.out.println();	
    		}
    		}  	
    	}

  2. #2
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Lightbulb

    system.out.println();
    emmm...

    System.out.println();
    :rolleyes:

    P.S. I dearly hope I understood the question...
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

Similar Threads

  1. Advanced Looping
    By nuggetman4 in forum New To Java
    Replies: 1
    Last Post: 05-10-2010, 06:54 AM
  2. Help with While and For Looping
    By gmoney8316 in forum New To Java
    Replies: 2
    Last Post: 03-03-2010, 10:54 PM
  3. looping and filtering
    By javafanatic in forum New To Java
    Replies: 14
    Last Post: 02-09-2010, 09:48 AM
  4. Looping Help Please
    By JonnySnip3r in forum New To Java
    Replies: 5
    Last Post: 01-31-2010, 05:57 AM
  5. how to do conditional looping?
    By chennee72 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-09-2008, 12:38 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
  •