title: Java won't run because there a break statement outside a loop, but I have it inside a loop
body: <p>I'm having two weird errors</p>
  
  <p>New error is when i tell java to draw a string that displays the coordinateness of x and y, It doesn't.</p>
  
  <pre><code>public void paint (Graphics g)
  {
      super.paint (g);
  
     //System.out.println ("Boolean: " + this.closeDoors);
  
  
      g.drawString("("+x+","+y+")",x,y);
  }
  </code></pre>
  
  <p>Link to my program if you to compile it.
  <a href="http://hotfile.com/dl/107032853/c81d927/Pigment.java.html" rel="nofollow">http://hotfile.com/dl/107032853/c81d927/Pigment.java.html</a></p>
  
  <p>This is my complete program</p>
  
  <pre><code>/*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  import javax.swing.*;
  import java.awt.*;
  import java.awt.event.*;
  import java.applet.Applet;
  import java.awt.Graphics;
  
  /**
   *
   * @author George Beazer
   */
  public class Pigment extends JApplet 
  {
      boolean closeDoors;
      private int x = 0;
      private int y = 0;
  
  
      public static void main(String [] args)
      {
              Pigment stuff = new Pigment();
      }
      public Pigment()
  
      {
  
          setBackground (Color.blue);
      }
  
      @Override
      public void init()
      {
           setLayout(new FlowLayout());
           addMouseListener(new MyMouseListener());
      }
      @Override
      public void paint (Graphics g)
      {
          super.paint (g);
  
         //System.out.println ("Boolean: " + this.closeDoors);
  
  
          g.drawString("("+x+","+y+")",x,y);
           if (x &gt; 35)
  
              {
                              g.drawLine (35, 50, 570, 50);
                  g.drawLine (35, 50, 250, 0);
                  g.drawLine (250, 0, 570, 50);
                  g.drawRect (50, 50, 500, 350);
                  g.fillRect (100, 75, 80, 80);
                  g.fillRect (400, 75, 80, 80);
                  g.fillRect (240, 200, 125, 200);
  
  
              }
  
          else
              {        
              g.drawLine (35, 50, 570, 50);
              g.drawLine (35, 50, 250, 0);
              g.drawLine (250, 0, 570, 50);
              g.drawLine (180, 120, 100, 120);
              g.drawLine (400, 120, 480, 120);
              g.drawLine (140, 75, 140, 160);
              g.drawLine (450, 75, 450, 160);
              g.drawRect (50, 50, 500, 350);
              g.drawRect (100, 75, 80, 80);
              g.drawRect (400, 75, 80, 80);
              g.drawRect (240, 200, 125, 200);
              g.drawOval (330,280, 20, 20);
              }
  
  
      }
      private class MyMouseListener implements MouseListener
      {
          public void mouseClicked (MouseEvent e)
          {
              x = e.getX();
              y = e.getY();
  
          }
  
          public void mouseEntered (MouseEvent e)
          {
  
  
          }
          public void mouseExited(MouseEvent e){}
          public void mousePressed (MouseEvent e){
  
          }
          public void mouseReleased (MouseEvent e){}
  
      }
  
  }
  </code></pre>