else if(d.equals(Direction.DOWN)){
size.height -= (point2.y - point.y);
}
resizedComponent.setPreferredSize(new Dimension(Math.max(size.width, 0), Math.max(size.height, 0)));
parent.revalidate();
parent.repaint();
fireSizeChanged(resizedComponent);
}
else{
index = getIndex();
}