aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Rectangle drawn when mouse  is dragged Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Rectangle drawn when mouse  is dragged" Watch "Rectangle drawn when mouse  is dragged" New topic

Rectangle drawn when mouse is dragged

Sanam Kumar

Joined: Jun 04, 2004
Posts: 9
Hi, i am stuck up with a problem,

when i click on a button on the applet
and when i drag the mouse and release it a rectangle has to be drawn,
it would be kindful if anyone could help me in getting this done

Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
The class Rectangle extends from Rectangle2D which extends RectangularShape. All three classes have methods for manipulating rectangles and these are listed in the Method Summary and Methods inherited from ... sections of the Rectangle api.
I agree. Here's the link:
subject: Rectangle drawn when mouse is dragged
Similar Threads
Rotate a rectangle drawn in Panel
Need to draw spiral within dynamically changing rectangle....
Rectangle drwan as mouse is dragged and released
To get the coordinates of mouse pointer...
Problem in finding the bounds of rectangle.....