ClassCastException when dropping an element from the palette