-2
我在弄清楚如何为选项窗格中使用的选项指定名称/标题,以便我可以在if语句中使用它们。这里是我到目前为止的代码:如何在if语句中使用选项窗格中的信息
int i = 0;
while(i<1){
JFrame frame = new JFrame();
String[] options = new String[2];
options[0] = new String("Peat");
options[1] = new String("Repeat");
JOptionPane.showOptionDialog(frame.getContentPane(),"Peat and Repeat were walking on a bridge\nPeat fell off, "
+ "who was left?","", 0,JOptionPane.INFORMATION_MESSAGE,null,options,null);
}
你会推荐我下一步做完这个“笑话”?