I made this minesweeper game earlier this summer. It shows many things, including:
array use,
1D array to 2D array,
gridlayout,
changing the way a JButton works depending on mouse button used,
floodfill,
loops,
GUI.
slightly long, 382 lines, can probably be condensed.
There is one known bug that i cannot seem to fix: when a floodfill causes a win, and the OK button is clicked on the win dialog, it will automatically click a button on the new game, not a problem usually, but in games that are set to be large with a small amount of bombs, it can cause an infinite loop :( , if you see a fix please comment or PM me, thanks.
have fun.