【发布时间】:2015-04-11 20:37:20
【问题描述】:
我不知道如何在 joptionpane 中打印出一个字符串和一个变量。可能吗?如果不是那我该怎么办?
String peopleadded = JOptionPane.showInputDialog("How many people do you want to add");
int peopleadded1 = Integer.parseInt(peopleadded);
String[][] People = new String[peopleadded1][2];
System.out.println("put your name in the array");
People[0][0] = JOptionPane.showInputDialog("Put your Name");
System.out.println("put your password in the array");
People[0][1] = JOptionPane.showInputDialog("Put your Password");
PrintStream person = System.out.printf("Your array num [%s] and name is %s and your password is %s", 0, People[0][0], People[0][1]);
JOptionPane.showMessageDialog(null, person);
【问题讨论】:
标签: java swing joptionpane