package project;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.border.AbstractBorder;

public class CustomBorder extends AbstractBorder {
	private int thickness;
	private Color lineColor;
	
	public CustomBorder(int thickness,Color lineColor){
		super();
		this.thickness=thickness;
		this.lineColor=lineColor;
		
	}

	@Override
	public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
		// TODO Auto-generated method stub
		
		super.paintBorder(c, g, x, y, width, height);
		Graphics2D g2d=(Graphics2D)g;
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
		g2d.setStroke(new BasicStroke(thickness));
		g2d.setColor(lineColor);
		g2d.drawRoundRect(x, y, width-1, height-1, 15, 15);
		//g2d.setColor(Color.gray);
		//g2d.fillRoundRect(x, y, width-1, height-1, 15, 15);
	}
	
	

}
