I have created, my First, Swing/AWT application. It does a search through jar and zip files looking for a class. My problem is this. I am passing a reference to two textareas to the search class. The search class is updating the left and right textarea's but they are not being refreshed until the entire search has completed. I think this is because I am performing the search outside of the actionPerformed, but I'm not sure how to go about fixing the problem. The actionPerformed method is listed below..
void jButton_Search_actionPerformed(ActionEvent e) {
String[] args = new String[3];
args[0] = "-a";
args[1] = jTextPath.getText();
args[2] = jTextPattern.getText();
int i = jComboBox_SearchType.getSelectedIndex();
switch (i) {
case 0:
args[0] = "-a";
args[1] = jTextPath.getText();
break;
case 1:
args[0] = "-c";
args[1] = jTextPath.getText();
break;
case 2:
args[0] = "-s";
args[1] = jTextPath.getText();
break;
case 3:
args[0] = "-d";
args[1] = jTextPath.getText();
break;
}
System.out.println(args[0]);
System.out.println(args[1]);
System.out.println(args[2]);
jTextArea_Search.append("\nStarting ZipSearch...\n");
JZSearch js = new JZSearch();
js.doZipSearch(args, jTextArea_Search, jTextArea_Found);
jTextArea_Search.append("\nCompleted ZipSearch...\n");
}
Do I need to use a
thread for the call to JZSearch?
TIA,
Greg