'XXXX' does not name a type

I am currently trying to use arduino and processing to create an ambilight effect for my computer monitor. I have the following code in my arduino but whenever i try to run it i get a fairly large list of errors underneath. I appreciate these may be obvious mistakes but I am only just starting out on arduino and could really use some help.
Code as follows:

import java.awt.;
import java.awt.image.
;

// Put the right screen size in here
int screenW = 1366;
int screenH = 768;

// Preview window size
int windowW = 100;
int windowH = 100;

// Define the box where we want to capture and analyse colour from
// The start point of the box (top and left coordinate)
int boxL = 633; // That's the middle of the screen
int boxT = 334;
// Size of the box
int boxW = 100;
int boxH = 100;

//How many pixels to skip while reading (the more you skip, it runs faster, but result might get worse)
int pixelSkip = 2;

// Screen Area to be captured (usually the whole screen)
Rectangle dispBounds;
// creates object from java library that lets us take screenshots
Robot bot;

void setup(){

// Create screenshot area
dispBounds = new Rectangle(new Dimension(screenW,screenH));
// Create Preview Window
size(windowW, windowH);

// Standard Robot class error check and Create screenshot Robot
try {
bot = new Robot();
}
catch (AWTException e) {
println("Robot class not supported by your system!");
exit();
}
}

void draw(){

//ARGB value of a pixel, contains sets of 8 bytes values for Alpha, Red, Green, Blue
int pixel;

int r = 0;
int g = 0;
int b = 0;

// Take screenshot
BufferedImage screenshot = bot.createScreenCapture(dispBounds);

// Pass all the ARGB values of every pixel into an array
int[] screenData = ((DataBufferInt)screenshot.getRaster().getDataBuffer()).getData();

//Find the RGB values of the region we want
for(int i = boxT; i < (boxT + boxH); i += pixelSkip){
for(int j = boxL; j < (boxL + boxW); j += pixelSkip){

pixel = screenData[ i*screenW + j ];
r += 0xff & (pixel>>16);
g += 0xff & (pixel>>8 );
b += 0xff & pixel;

}
}

// take average RGB values.
r = r / (boxH/pixelSkip * boxW/pixelSkip);
g = g / (boxH/pixelSkip * boxW/pixelSkip);
b = b / (boxH/pixelSkip * boxW/pixelSkip);

color rgb = color((short)r, (short)g, (short)b);
fill(rgb);
rect(0, 0, 100, 100);

println(frameRate);
}

Errors as follows:
sketch_apr16a:1: error: 'import' does not name a type
sketch_apr16a:2: error: 'import' does not name a type
sketch_apr16a:24: error: 'Rectangle' does not name a type
sketch_apr16a:26: error: 'Robot' does not name a type
sketch_apr16a.ino: In function 'void setup()':
sketch_apr16a:31: error: 'dispBounds' was not declared in this scope
sketch_apr16a:31: error: expected type-specifier before 'Rectangle'
sketch_apr16a:31: error: expected ;' before 'Rectangle' sketch_apr16a:33: error: 'size' was not declared in this scope sketch_apr16a:37: error: 'bot' was not declared in this scope sketch_apr16a:37: error: expected type-specifier before 'Robot' sketch_apr16a:37: error: expected ;' before 'Robot'
sketch_apr16a:39: error: expected type-specifier before 'AWTException'
sketch_apr16a:39: error: exception handling disabled, use -fexceptions to enable
sketch_apr16a:39: error: expected )' before 'e' sketch_apr16a:39: error: expected {' before 'e'
sketch_apr16a:39: error: 'e' was not declared in this scope
sketch_apr16a:39: error: expected ;' before ')' token sketch_apr16a.ino: In function 'void draw()': sketch_apr16a:55: error: 'BufferedImage' was not declared in this scope sketch_apr16a:55: error: expected ;' before 'screenshot'
sketch_apr16a:58: error: expected unqualified-id before '[' token
sketch_apr16a:64: error: 'screenData' was not declared in this scope
sketch_apr16a:77: error: 'color' was not declared in this scope
sketch_apr16a:77: error: expected `;' before 'rgb'
sketch_apr16a:78: error: 'rgb' was not declared in this scope
sketch_apr16a:78: error: 'fill' was not declared in this scope
sketch_apr16a:79: error: 'rect' was not declared in this scope
sketch_apr16a:81: error: 'frameRate' was not declared in this scope
sketch_apr16a:81: error: 'println' was not declared in this scope

What has this got to do with Arduino?

Are you trying to compile Processing/Java code using the Arduino IDE?

Clue:import java.awt.*;

The Arduino IDE uses C/C++, this looks like java...

import java.awt.;
import java.awt.image.
;

Remove these two lines and then see what you have.

Remove these two lines and then see what you have

Pssst, void draw()