public void paint(Graphics g) {
drawThickLine(g, 0, 0, getSize().width, getSize().height, 5, new Color(0).black);
}
public void drawThickLine(Graphics g, int x1, int y1, int x2, int y2, int thickness, Color c) {
// The thick line is in fact a filled polygon
g.setColor(c);
int dX = x2 - x1;
int dY = y2 - y1;
// line length
double lineLength = Math.sqrt(dX * dX + dY * dY);