Graphics2D中的setStroke方法可以设定线宽,具体可查帮助。