Put your message in a JLabel and pass that to JOptionPane.showMessageDialog(), instead of passing the string.
Code:
// display result
JLabel message = new JLabel("The diameter is: " + diameter, JLabel.LEADING);
JOptionPane.showMessageDialog( null, message );