如何在JComboBox
?
我试过这段代码:
double combofir = Integer.parseInt(jComboBox1.getSelectedItem().toString());
// in this line how can I set the item that I want to know?
double x = Integer.parseInt(jTextField1.getText());
double combosec = Integer.parseInt(jComboBox2.getSelectedItem().toString());
if (combofir == combosec) {
double a = 72.873;
double result = x*a;
jTextField2.setText(""+result);
}