Java绘制不规则图形的源代码,类似于一个Java小画板,可以画出一些基于线条的图形,比如曲线,直线,还可用来写字,示例截图如上图所示。以下是相关源代码: protected void processMouseEvent(MouseEvent e) { //鼠标事件处理 if(e.getID() == MouseEvent.MOUSE_PRESSED) { aPoint = e.getPoint(); //得到当前鼠标点 gPath = new GeneralPath(); //重新实例化GeneralPath对象 gPath.moveTo(aPoint.x,