How can I change the size of a figure made in Java Graphics2D with a slider?
问题 I'm trying to make a program with java using Graphics 2D that paints polygons between 3 and 8 sides and that I can resized with a slider but I do not know how to do for change it size with the slider evenly. Here is a example of my pentagon drawn if (sides == 5){ g.drawLine(110+x,135-y, 10+x,205-y); g.drawLine(10+x,205-y, 48+x, 320-y); g.drawLine(48+x,320-y, 170+x,320-y); g.drawLine(170+x,320-y, 205+x,205-y); g.drawLine(205+x,205-y, 110+x,135-y); } Now I want to change its size evenly. (I can