What is a dialog?

Dialogs are separate windows that display information and usually gather additional information from the program user.

Adding maze and anti-maze variables

To create a custom dialog of options for the Maze Generator program, we must first create instance variables for the different types of mazes.

In the MazeGenerator.java file:

  1. Create two public static final integer instance variables called TYPE_MAZE and TYPE_ANTIMAZE, set to 0 and 1, respectively.
  2. Create a private integer instance variable called type, initialized to TYPE_ANTIMAZE.
...
private static final long serialVersionUID = 1L;
public static final int TYPE_MAZE = 0; 
public static final int TYPE_ANTIMAZE = 1; 
public int type = TYPE_ANTIMAZE;
...

Add the above lines of code to create the instance variables for different types of mazes.

Get hands-on with 1200+ tech skills courses.