java用填充多边形的方法填充一个三角形 主要代码: Icon icon = new Icon() { @Override public void paintIcon(Component c, Graphics g, int x, int y) { Graphics2D g2d = (Graphics2D) g; Polygon plygon = new Polygon(); plygon.addPoint(0, 30); plygon.addPoint(30, 30); plygon.addPoint(30, 0);