此代码正在运行。but the problem is when NO_OPTION is selected then the window is disposed. 我想在选择 NO_OPTION 时保留窗口?你能给点建议吗?
int dialogButton = JOptionPane.YES_NO_OPTION;
JOptionPane.showConfirmDialog (null, "First Row Will Selected As Default!! Do You Want To Close?","Warning",dialogButton);
if(dialogButton == JOptionPane.YES_OPTION){
int row = table.getSelectedRow();
int col = table.getSelectedColumn();
finalOID=(String)table.getModel().getValueAt(row, col);
System.out.println("cancel clicked first oid:"+finalOID);
dispose();
}