I have the following code but I don't know how to add all of the items to my combobox.
DefaultTableModel rs = MyDB.DataTable("SELECT `Activity` FROM `transactions` WHERE `Group` = '" + Gname.getText()+ "' OR `Group` = 'ALL'");
DefaultComboBoxModel dmc = new DefaultComboBoxModel();
dmc.addElement("");
if (rs.getRowCount() > 0) {
dmc.addElement(rs.getValueAt(0,0).toString());
}
cboItem.setModel(dmc);
It only adds one item to my DefaultTableModel
, how can I add all of them?