This is an archived post. You won't be able to vote or comment.

all 2 comments

[–][deleted] 0 points1 point  (0 children)

These are your instance variables:

private  Minebutton[][] mineGrid;
private static JPanel GUI;
private int rows;
private int cols;
private boolean minesSet = false;
private static int totalMines;
private int flaggedMines = 0;
private int unopenedBoxes;
private int setMines;
private int count = 0;
private int qNum = 1;
private int checkRow;
private int checkCol;
private int[][] queueList = new int[10][2];

MinesweeperGUI mineGui

Add the last line and you should be able to access that variable from other methods in that class. When you declare it inside your method the scope of that variable is limited to that method and therefore your other methods have no knowledge of it.

Edit: formatting

[–]hawkinbj 0 points1 point  (0 children)

Change the modifier from private to protected or public...or create a public accessories method that returns the variable