-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);
}
你會推薦我下一步做完這個「笑話」?