int centerX = getCenter( x1, x2, x3 ); int centerY = getCenter( y1, y2, y3 );; boolean isPositionMoved; do {  g.drawLine( x1, y1, x2, y2 ); g.drawLine( x2, y2, x3, y3 ); g.drawLine( x3, y3, x1, y1 );  isPositionMoved = false; if (x1 < centerX) { x1++; isPositionMoved = true; } else if (x1 > centerX) { x1--; isPositionMoved = true; } if (x2 < centerX) { x2++; isPositionMoved = true; } else if (x2 > centerX) { x2--; isPositionMoved = true; } if (x3 < centerX) { x3++; isPositionMoved = true; } else if (x3 > centerX) { x3--; isPositionMoved = true; } if (y1 < centerY) { y1++; isPositionMoved = true; } else if (y1 > centerY) { y1--; isPositionMoved = true; } if (y2 < centerY) { y2++; isPositionMoved = true; } else if (y2 > centerY) { y2--; isPositionMoved = true; } if (y3 < centerY) { y3++; isPositionMoved = true; } else if (y3 > centerY) { y3--; isPositionMoved = true; } } while (isPositionMoved);
	public static void fillTriangle(int x1,            int y1,            int x2,            int y2,            int x3,            int y3, Graphics g) 	{		//#if polish.midp2			g.fillTriangle(x1, y1, x2, y2, x3, y3);		//#else			// draw lines:			//TODO robert implement DrawUtil.fillTriangle		//#endif	}