diff --git a/src/main/java/org/isf/medicalinventory/gui/InventoryEdit.java b/src/main/java/org/isf/medicalinventory/gui/InventoryEdit.java index 27ce3940e6..c685d4b0fb 100644 --- a/src/main/java/org/isf/medicalinventory/gui/InventoryEdit.java +++ b/src/main/java/org/isf/medicalinventory/gui/InventoryEdit.java @@ -73,6 +73,8 @@ import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; import org.isf.generaldata.GeneralData; import org.isf.generaldata.MessageBundle; @@ -91,7 +93,6 @@ import org.isf.menu.manager.Context; import org.isf.menu.manager.UserBrowsingManager; import org.isf.stat.gui.report.GenericReportPharmaceuticalInventory; -import org.isf.stat.manager.JasperReportsManager; import org.isf.supplier.manager.SupplierBrowserManager; import org.isf.supplier.model.Supplier; import org.isf.utils.db.NormalizeString; @@ -229,7 +230,6 @@ private void fireInventoryUpdated() { private MedicalDsrStockMovementTypeBrowserManager movTypeManager = Context.getApplicationContext().getBean(MedicalDsrStockMovementTypeBrowserManager.class); private SupplierBrowserManager supplierManager = Context.getApplicationContext().getBean(SupplierBrowserManager.class); private WardBrowserManager wardManager = Context.getApplicationContext().getBean(WardBrowserManager.class); - private JasperReportsManager jasperReportsManager = Context.getApplicationContext().getBean(JasperReportsManager.class); public InventoryEdit() { mode = "new"; @@ -1127,6 +1127,8 @@ public void valueChanged(ListSelectionEvent e) { }); DefaultCellEditor cellEditor = new DefaultCellEditor(jTextFieldEditor); jTableInventoryRow.setDefaultEditor(Integer.class, cellEditor); + TableRowSorter sorter = new TableRowSorter<>(model); + jTableInventoryRow.setRowSorter(sorter); } return jTableInventoryRow; }