@Override public void setSize(int x, int y) { super.setSize(x, y); bar.setLocation(bar.getWidth() / 2, 0); }