Java program to move a rectangle on mouse click
Not what you're looking for?
Write an application that draws a rectangle within a panel as shown in the attachment p10.png .
When user clicks in a point left of the rectangle, it moves 10px to left. It also moves to right by 10px if user clicks on a point right to the rectangle. Clicking in any other areas such as above, inside or below the rectangle will do nothing.
I have to compile and execute the program at commandline in Java.
Purchase this Solution
Solution Summary
Java compiler and Java version "1.7.0_21" were used during development and testing of the attached program. Response includes instructions to compile and execute the program at commandline.
Solution Preview
Please rename 565681-DrawRect.java as DrawRect.java before you compile and execute the ...
Purchase this Solution
Free BrainMass Quizzes
Javscript Basics
Quiz on basics of javascript programming language.
Basic UNIX commands
Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.
Basic Computer Terms
We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.
C# variables and classes
This quiz contains questions about C# classes and variables.
C++ Operators
This quiz tests a student's knowledge about C++ operators.