コード例 #1
0
 private void btnSearchActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btnSearchActionPerformed
   String id = txtSearch.getText(); // Get the ID from the text field.
   if (id.isEmpty()) {
     productModel.updateItems(dao.getAll());
   } else {
     productModel.updateItems(
         dao.getById(id)); // Update the model with the product that is retrieved from getById.
   }
 } // GEN-LAST:event_btnSearchActionPerformed