private void search() { btnSearch.setEnabled(false); Enums.ClientType client_type = documentSearchComponent.getContactableType(); Long client_id = documentSearchComponent.getClient_id(); Date from = dtFrom.getDate(); Date to = dtTo.getDate(); if (client_id == null) { JOptionPane.showMessageDialog( null, "Select agent/customer", "Search", JOptionPane.WARNING_MESSAGE); btnSearch.setEnabled(true); return; } task = new AccountsHistoryTask( client_type, client_id, from, to, progressBar, Enums.SaleType.TKTSALES); task.addPropertyChangeListener(this); task.execute(); }