【发布时间】:2018-09-29 21:43:12
【问题描述】:
public class SimpleDialogueBox {
public static void main(String[] args){
String name = JOptionPane.showInputDialog("Name");
String age = JOptionPane.showInputDialog("age");
String address = JOptionPane.showInputDialog("Address");
String contact = JOptionPane.showInputDialog("Contact Number");
JOptionPane.showMessageDialog(null, "User information is", name);
}
}
我想要这样的显示:
【问题讨论】:
-
请阅读How to Ask并花时间用正确格式的代码写一个正确的问题
-
该方法采用普通的
String,没什么花哨的。只需构建您想要的String并显示它。 -
我无法想象一个更糟糕的 UI 交互。是否要连续弹出四个选项窗格来获取四条相关信息?想到这我就癫痫发作了。
标签: java