ダイアログ ボックスには、ASCII に従って 1 文字先のすべてが表示され、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);
}
}