编辑:这是您的基本错误..您正在ActionPerformed中调用该方法!
classConstructor(){setDiscountNames("Fixed", jComboBox1); // call this method here.. This will work.}如果值打印正确,请尝试此操作。
List<String> strings = new ArrayList<String>();while(rs.next()){ strings.add(rs.getString("Name")); // Confirm if "Name" is valid }cbox.addItem(strings);


