该对话框根据ASCII显示前面一个字符的所有内容,在通过dos运行程序时遇到同样的问题。
请有人帮帮我!
import javax.swing.JOptionPane;
import javax.swing.JDialog;
import javax.swing.UIManager;
class MyFirstGUI {
public static void main(String[] args) {
JDialog.setDefaultLookAndFeelDecorated(true);
System.out.println(UIManager.getLookAndFeel().getName());
String first = JOptionPane.showInputDialog("Enter the first number");
String second = JOptionPane.showInputDialog("Enter the second number");
int n = Integer.parseInt(first);
int m = Integer.parseInt(second);
int sum = n + m;
JOptionPane.showMessageDialog(null, "sum = "+sum, "Sum of 2 numbers", JOptionPane.PLAIN_MESSAGE);
}
}