import javax.swing.JOptionPane; public class SmallApp { public static void main (String args[]) { String Number; int number; Number = JOptionPane.showInputDialog("Enter the number to square"); number = Integer.parseInt(Number); JOptionPane.showMessageDialog(null, number + " squared is " + Square(number)); System.exit(0); } public static int Square (int n) { return n*n; } }