@Override public void keyReleased(KeyEvent e) { javax.swing.JTextField txtSearch = home.getSearching().getTxtSearch(); if (e.getSource().equals(txtSearch)) { modelSearching.setElements( mdlCustomers.searchAllCustomerByName("%" + txtSearch.getText().toLowerCase() + "%")); } }
public ControllerHome(HomeFrame home) { this.home = home; modelSearching = new SearchingModel<Customers>( new String[] {"ID", "NOMBRE", "APELLIDOS", "CIUDAD"}, new SearchingCtrlCustomers()); mdlCustomers = new ModelCustomers(); modelSearching.setElements(mdlCustomers.searchAllCustomerByName("%%")); home.setSearching(new JSearching(modelSearching)); }
@Override public void actionPerformed(ActionEvent e) { // Menu administrator if (e.getSource().equals(home.getMnuiCustomers())) { itla.jpuppy.business.EntityManagerCreator.close(); new ManageCustomersMenu(home, true).showFrame(); return; } if (e.getSource().equals(home.getMnuiPatients())) { itla.jpuppy.business.EntityManagerCreator.close(); new ManagePatients(home, true).showFrame(); return; } if (e.getSource().equals(home.getMnuiSpecies())) { itla.jpuppy.business.EntityManagerCreator.close(); new ManageSpecies(home, true).showFrame(); return; } if (e.getSource().equals(home.getMnuiBreeds())) { itla.jpuppy.business.EntityManagerCreator.close(); new ManageBreedMenu(home, true).showFrame(); return; } if (e.getSource().equals(home.getMnuiEmployees())) { itla.jpuppy.business.EntityManagerCreator.close(); new ManageEmployeesMenu(home, true).showFrame(); return; } if (e.getSource().equals(home.getMnuiUsers())) { itla.jpuppy.business.EntityManagerCreator.close(); new ManageUsersMenu(home, true).showFrame(); return; } if (e.getSource().equals(home.getMnuiProductsServices())) { itla.jpuppy.business.EntityManagerCreator.close(); new ManageArticlesMenu(home, true).showFrame(); return; } if (e.getSource().equals(home.getMnuiAppointments())) { itla.jpuppy.business.EntityManagerCreator.close(); new ManageAppointmentsMenu(home, true).showFrame(); return; } if (e.getSource().equals(home.getMnuiConsults())) { itla.jpuppy.business.EntityManagerCreator.close(); new ManageConsultations(home, true).showFrame(); return; } if (e.getSource().equals(home.getMnuiInvoice())) { itla.jpuppy.business.EntityManagerCreator.close(); home.dispose(); new InvoiceMenu().showFrame(); return; } // Menu User if (e.getSource().equals(home.getMnuiExit())) { home.dispose(); return; } // Menu about Us if (e.getSource().equals(home.getMnuiAcerca())) { new AboutUsFrame(home, true).showFrame(); return; } // e.getSource().equals() }
@Override public void windowGainedFocus(WindowEvent e) { modelSearching.setElements( mdlCustomers.searchAllCustomerByName( "%" + home.getSearching().getTxtSearch().getText().toLowerCase() + "%")); }