import javax.swing.*; public class StringFun { public static void main(String[] args) { String inputString = JOptionPane.showInputDialog("Please enter a string:"); int len = inputString.length(); JOptionPane.showMessageDialog(null, "The length of the string is " + len); // place your code here } }