Rectangle d1 = (Rectangle) dirtyComponents.get(c1);
Rectangle d1 = (Rectangle) dirtyComponentsWork.get(c1);
    public int compare(Object o1, Object o2)    {      if (o1 instanceof JComponent && o2 instanceof JComponent)        {          JComponent c1 = (JComponent) o1;          Rectangle d1 = (Rectangle) dirtyComponents.get(c1);          JComponent c2 = (JComponent) o2;          Rectangle d2 = (Rectangle) dirtyComponents.get(c2);          return d2.width * d2.height - d1.width * d1.height;        }        throw new ClassCastException("This comparator can only be used with "                                     + "JComponents");    }