Text fields allow the program user to enter text. Radio buttons allow the user to select one of several choices.

Adding input fields to the dialog

You can now start adding content to the dialog.

  1. Go back to OptionsDialog.java.
  2. Add private JTextField instance variables called rowsField and colsField, initialized by calling their constructors, each with 3 as the number of columns.
  3. Add private JRadioButton instance variables called mazeButton and antiMazeButton, initialized by calling their constructors, with the text "Maze" and "Anti-Maze", respectively.
...
  private int cols = 0;
  private int type = 0;
___________ rowsField = _________________; 
___________ colsField = _________________; 
___________ mazeButton = _________________; 
___________ antiMazeButton = ________________;
...

Get hands-on with 1200+ tech skills courses.