@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		Graphics2D g2 = (Graphics2D) g;
		int width = this.getWidth();
		int height = this.getHeight();

		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
	    g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
		
		if (this.getBorder() == null) {
			// Add rounded image corners mask if no border is set
			g2.setClip(new RoundRectangle2D.Float(0, 0, width, height, cornerRadius, cornerRadius));
		}
		
		g2.drawImage(image, 0, 0, width, height, null);
		    
		if (this.getBorder() == null) {
		    // Draw border if no default one set
			g2.setClip(null);
 			g2.setColor(new Color(200, 200, 200));
 			g2.drawRoundRect(0, 0, width - 1, height - 1, cornerRadius, cornerRadius);
		}
	}