# Illegal modifier for the local class Notepad; only abstract or final is permitted

**URL:** <https://discourse.processing.org/t/illegal-modifier-for-the-local-class-notepad-only-abstract-or-final-is-permitted/30831>\
**Category:** Beginners\
**Created:** [June 21, 2021, 8:51am UTC](https://discourse.processing.org/t/illegal-modifier-for-the-local-class-notepad-only-abstract-or-final-is-permitted/30831 "2021-06-21T08:51:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MoonAlien822](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Post date:** [June 21, 2021, 8:51am UTC](https://discourse.processing.org/t/illegal-modifier-for-the-local-class-notepad-only-abstract-or-final-is-permitted/30831/1 "2021-06-21T08:51:53Z")

</div>

why does my code return the error: Illegal modifier for the local class Notepad; only abstract or final is permitted

this is the code:

```auto
`int x=1;
int y=1;

color ring1 = color(0,0,0);
color ring2 = color(0,0,0);
color ring3 = color(0,0,0);

import java.awt.Robot;
import java.awt.image.BufferedImage;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;

public class Notepad {

    static int keyInput[] = { KeyEvent.VK_J, KeyEvent.VK_A, KeyEvent.VK_V,
            KeyEvent.VK_A, KeyEvent.VK_SPACE };
            
            public static void main(String[] args) throws Exception {

        Runtime.getRuntime().exec("notepad");

        Robot robot = new Robot();
        for (int i = 0; i < keyInput.length; i++) {
            robot.keyPress(keyInput[i]);
            robot.delay(100);}}

Robot robot;
void setup() {
  size(1500, 3000);
  try {
    robot = new Robot();
  } 
  catch (Exception e) {
    println(e.getMessage());
  }
}

void draw() {
  background(0);
  Rectangle r = new Rectangle(x, y, width, height);
  BufferedImage img1 = robot.createScreenCapture(r);
  PImage img2 = new PImage(img1);
  image(img2, 0, 0);
  x++;
  y++;
  color colorFromGet = get(x,y);

if ( colorFromGet == ring1 ){
  print( "x=" + x + " y=" + y );
if ( colorFromGet == ring2 ){
  print( "x=" + x + " y=" + y );;} 
if ( colorFromGet == ring3 ){
  print( "x=" + x + " y=" + y );;} 
  
  y++;
  if(y=3000){y=0; x++;}
  print(y);
}

}}`

```

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [June 23, 2021, 6:34am UTC](https://discourse.processing.org/t/illegal-modifier-for-the-local-class-notepad-only-abstract-or-final-is-permitted/30831/2 "2021-06-23T06:34:33Z")

</div>

one of the problems is that `Notepad` wraps everything including setup and draw. This is perhaps not what you want. Tip: use `ctrl+t` (or `command+t` on mac) on the Processing IDE to format the code, then you see the structure better!
