[COLOR=#3E3E3E][I]//Dialog box for length[/I][/COLOR] [COLOR=#3E3E3E][I]JOptionPane.showInputDialog(null, "Enter the length : " , "Length" , JOptionPane.INFORMATION_MESSAGE); [/I][/COLOR][COLOR=#008000]//Command prompt input for length[/COLOR] [COLOR=#3E3E3E][I]double length = input.nextDouble();[/I][/COLOR] [COLOR=#3E3E3E][I]//Dialog box for width[/I][/COLOR] [COLOR=#3E3E3E][I]JOptionPane.showInputDialog(null, "Enter the width : " , "Width" , JOptionPane.INFORMATION_MESSAGE); [/I][/COLOR][COLOR=#008000]//Command prompt input for width[/COLOR] [COLOR=#3E3E3E][I]double width = input.nextDouble(); [/I][/COLOR] Your code still includes the commands required for input from the command prompt. Therefore after you use your first dialog box, your program then waits for you to input a value using the command prompt.