我想每次按取消选项时返回第一个对话框

时间:2018-09-05 12:05:42

标签: java if-statement joptionpane

每当我按下取消按钮时,我想返回到我的第一个对话框“ myPanel”。我设法做到了,但只能使用一次。看一看。感谢您的帮助。预先感谢

int IPLBW = JOptionPane.showConfirmDialog(null, myPanel, "IPL BW 
UTILIZATION", 
JOptionPane.OK_CANCEL_OPTION);
 nt laten = JOptionPane.showConfirmDialog(null, myPanel2, "IPL BW LATENCYN", 
 JOptionPane.OK_CANCEL_OPTION);


   if (IPLBW == JOptionPane.OK_OPTION && laten ==JOptionPane.OK_OPTION ) 
{  
JOptionPane.showConfirmDialog(null, myPanel, "IPL BW UTILIZATION", 
JOptionPane.OK_CANCEL_OPTION);
               }      
  /*PRINTS SOMETHING FROM THE VALUE OF MYPANEL AND MYPANEL2*/

  else if (laten == JOptionPane.CANCEL_OPTION) {
       JOptionPane.showConfirmDialog(null, myPanel, "IPL BW UTILIZATION", 
 JOptionPane.OK_CANCEL_OPTION);
       JOptionPane.showConfirmDialog(null, myPanel2, "IPL BW LATENCY", 
 JOptionPane.OK_CANCEL_OPTION);
               }

0 个答案:

没有答案