代码我就不写了,说一下思路,用这4个点构造一个多边形
Polygon(int[] xpoints, int[] ypoints, int npoints) 
          Constructs and initializes a Polygon from the specified parameters
生成多边形实例后可以直接调用如下方法,专门用来判断是否包含一个点,方法如下
contains(Point p) 
          Determines whether the specified Point is inside this Polygon
Polygon位于java.awt.*包中
明白了吧?