public void setSelected(boolean b) { super.setSelected(b); rectangle.setLineWidth(b ? 3 : 1); repaint(); }