import javax.swing .*;
import java .awt .*;
import java .applet.*;
public class JApplet extends Applet
{
public void paint(Graphics Sketch)
{
int Row,Col,k,Side,Height ;
int PointAx,PointBx,PointCx,PointDx,PointEx,PointFx,Po intGx ;
int PointAy,PointBy,PointCy,PointDy,PointEy,PointFy,Po intGy ;
int CenterAx,CenterAy,CenterBx,CenterBy,CenterCx,Cente rCy,CenterDx,CenterDy,Offset;
Dimension RowCol;
RowCol = getSize() ;
Row = RowCol.width - 1 ;
Col = RowCol.height - 1;
Sketch.setColor(Color.red );
Sketch.drawLine(0, 0,Row, 0);
Sketch.drawLine(0,Col,Row,Col);
Sketch.drawLine(0, 0, 0,Col);
Sketch.drawLine(Row,0,Row,Col);
Sketch.setColor(Color.blue );
Sketch.drawLine(Row/2, 0,Row/2,Col );
Sketch.drawLine(0 ,Col/2,Row ,Col/2);
Offset = Col/16 ;
CenterAx = Row/4 ;
CenterAy = Col/4 ;
CenterBx = 3*Row/4;
CenterBy = Col/4 ;
CenterCx = Row/4 ;
CenterCy = 3*Col/4;
CenterDx = 3*Row/4;
CenterDy = 3*Col/4;
// STAR OF DAVID
Height = (Col - 2 * Offset) / 2 ;
Side = (int) (2 * Math.sqrt(3) * Height / 3);
PointAx = CenterDx ;
PointAy = Col /2 + Offset / 2 ;
PointBx = CenterDx + Side / 2 ;
PointBy = Col - Offset /2 ;
PointCx = CenterDx - Side / 2 ;
PointCy = PointBy ;
PointDx = CenterDx + Side / 2 ;
PointDy = Col / 2 + Offset / 2;
PointEx = PointAx ;
PointEy = Col - Offset / 2 ;
PointFx = CenterDx - Side / 2 ;
PointFy = PointDy ;
Sketch.setColor(Color.orange);
Sketch.drawLine(PointAx,PointAy,PointBx,PointBy);
Sketch.drawLine(PointBx,PointBy,PointCx,PointCy);
Sketch.drawLine(PointCx,PointCy,PointAx,PointAy);
Sketch.drawLine(PointDx,PointDy,PointEx,PointEy);
Sketch.drawLine(PointEx,PointEy,PointFx,PointFy);
Sketch.drawLine(PointFx,PointFy,PointDx,PointDy);
}
}