Without seeing this part of the code, this is just a guess, but I think that you are creating a new form in your ShapetoResize.resizeSE(int x, int y); method ShapetoResize.resizeSE(int x, int y); creating two forms.
I assume this is your own method, because there is no resizeSE available on the Rectangle or in the Shape interface (two built-in forms). Of course, there is no paint method on the Shape interface, so you probably also use your own interface (which would be confusing since you did not provide code for this Shape interface). If you post code for these methods, we can confirm.
Here's an example of how your code (and SSCCE) works together. I limited this to only the Rectangles (since they were the only ones built into Shape ) and removed a lot of things not related to resizing. If you still have problems, try to recreate the problem using this example:
import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.ArrayList; public class ShapeResizer extends Box{ Dimension preferredSize = new Dimension(400,300); public ArrayList<Shape> myShapes = new ArrayList();
source share