i'm starting to work on a level editor for my 2d platform game. the platforms are rectangles, so i'd like it to work like this:
the user selects the "platform" tool form the tool box. then, when he starts dragging the mouse, a new rectangle platform is created between the initial drag point and the location of the mouse. when the user releases the mouse the platform is set.
if the user clicks and drags inside a platfrom he can move it, and if he clicks and drags on it's bounds he can resize it. nothing non-standard.
the question is, is there somethin in the sun library that i can inherit from, or do i have to create my code from scratch?
i thought about using drag and drop, but that's useful when i want to move objects from one container to another, no?
There is no pre-built "rubberbanding" you cna just call as a single emthod.
Most system that rubberbad do so by using an XOR draw of a line over the screen. That you can do through Java2D.