Error - Cannot find a class or type named "Dimension"
in
Programming Questions
•
8 months ago
Hello. I am brand new to Processing and have a problem. I am reading the book "Arduino Cookbook" by Margolis and on page 128 there is a Processing sketch to move a mouse from the Arduino. When I go to run the sketch I get the "Cannot find a class or type named "Dimension"". I have run other sketches in Processing with no problems but they never used Dimension before. I reloaded Processing and downloaded the latest Java but to no avail.
I am running Windows 7 32 bit on a laptop. Part of the code looks like:
class arduMouse { Robot myRobot; // create object from Robot class; static final short rate = 4; // pixels to move int centerX, centerY; arduMouse() { try { myRobot = new Robot(); } catch (AWTException e) { e.printStackTrace(); } Dimension screen = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); centerY = (int)screen.getHeight() / 2 ; centerX = (int)screen.getWidth() / 2; }
Ideas? Thanks!
1