View Single Post
  #11 (permalink)  
Old 10-23-2007, 11:15 PM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
Code:
int gridSquares; do { String input = JOptionPane.showInputDialog( "Enter number of rows and columns you want grid to contain\n" + "(For example entering 2 will create a 2x2 grid)\n"); gridSquares = Integer.parseInt( input ); if(gridSquares < 1 || gridSquares > 5) JOptionPane.showMessageDialog(null, "Number must be between 1 and 5", "Input Error", JOptionPane.ERROR_MESSAGE); } while(gridSquares < 1 || gridSquares > 5);
Reply With Quote