@Override protected void paintComponent(Graphics g) { // Draw Background. if (isEnabled()) { g.setColor(mouseStatus.getColor()); } else { g.setColor(Color.WHITE.darker()); } switch (btnStyle) { case Corner: g.drawRoundRect( 0, 0, this.getWidth() - 1, this.getHeight() - 1, CORNER_ANGLE, CORNER_ANGLE); g.fillRoundRect( 0, 0, this.getWidth() - 1, this.getHeight() - 1, CORNER_ANGLE, CORNER_ANGLE); break; case Rectangle: g.drawRect(0, 0, this.getWidth(), this.getHeight()); g.fillRect(0, 0, this.getWidth(), this.getHeight()); break; case Rectangle3D: g.fill3DRect(0, 0, this.getWidth(), this.getHeight(), true); break; default: break; } }