📅  最后修改于: 2022-03-11 14:52:35.598000             🧑  作者: Mango
//using a combobox to do basic sums
int iNum1 = 420;
int iNum2 = 69;
if (combobox.getSelectedItem().equals("Add"))
int iAns = iNum1 + iNum2;
else if (combobox.getSelectedItem().equals("Subtract"))
int iAns = iNum1 - iNum2;