final int defaultWidth, final int defaultHeight) {
comp.setLocation(getPreference(propX, defaultY), getPreference(propY, defaultX));
comp.setSize(getPreference(propWidth, defaultWidth), getPreference(propHeight, defaultHeight));
comp.addComponentListener(new ComponentAdapter() {
@Override
public void componentMoved(ComponentEvent e) {
setPreference(propX, e.getComponent().getX(), false);
setPreference(propY, e.getComponent().getY(), true);
}