Question: Write a program that displays a regular polygon and uses two buttons named +1 and -1 to increase or decrease the size of the polygon,
Write a program that displays a regular polygon and uses two buttons named +1 and -1 to increase or decrease the size of the polygon, as shown in the following figure.
Create the RegularPolygonPane class for displaying an n-sided regular polygon. n is a data field in RegularPolygonPane.
Write the code to handle the action events from the buttons to change the number of the sides in a RegularPolygonPane object and redisplay it.

Here is the code:
public class Polygon extends Application { /** * The main method is only needed for the IDE with limited * JavaFX support. Not needed for running from the command line. */ public static void main(String[] args) { launch(args); }
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
