title: Filling a drawline triangle with for loops
body: <p>Hello I am a beginning programming student and I am stuck on for loops. My task is to fill a triangle (that I have already drawn) using a for loop. The idea is to keep drawing lines inside the triangle until it is filled. </p>
  
  <pre><code>import javax.swing.JApplet;
  import java.awt.*;
  
  public class OneLine extends JApplet
  {
  public void paint (Graphics page)
  {
  
      page.drawLine (120,130,280,130);
      page.drawLine (120,130,200,65);
      page.drawLine (200,65,280,130);// 
  
  }
  }
  </code></pre>
  
  <p>This is the triangle I have so far. I was thinking that to fill it I would use a loop somewhat like</p>
  
  <pre><code>int x1=120;
  int y1=130;
  int x2=280;
  int y2=130;
  for (int x1&gt;120 &amp;&amp; int y1&gt;130; page.drawLine x1-1,y1-1,x2-1,y2-1);
  </code></pre>
  
  <p>That doesn't look right at all however. I'm just learning loops, so I'm confused as to how to write the code. Can anyone help me out? I know there is a fill.polygon method but I am not supposed to use that here.</p>