title: Return outside method error
body: <pre><code>boolean openingboard;
  {   
  Robot robot = new Robot();
  Color color3 = new Color(108, 25, 85);
  Rectangle rectangle = new Rectangle(0, 0, 1365, 770);
      while(true)
      {
      BufferedImage image = robot.createScreenCapture(rectangle);
      search: for(int x = 0; x &lt; rectangle.getWidth(); x++)
          {
          for(int y = 0; y &lt; rectangle.getHeight(); y++)
              {
                  if(image.getRGB(x, y) == color3.getRGB())
                  {
                      System.out.println("About to finish and return true");
                      return true;
                  }
                  System.out.println("About to finish and return false");
              }
          }
      }
  }
  </code></pre>
  
  <p>the error is:
  java:71: return outside method</p>
  
  <p>return true </p>
  
  <p>^</p>
  
  <p>i don't know what this is happening please help!</p>