I am facing a peculiar problem, hoping someone can shed some light on
it.
I am trying to use the class startSearch to handle the button click
action Event. All my GUI is in the GUIThread class. But when I try to
access the startSearch constructor it gives me an error that
constructor could not be found.
File: GUIThread.java
=====================
class GUIThread extends Thread {
...
bSearch = new JButton("SEARCH") ;
bSearch.addActionListener
(new startSearch(tf1.getText(),tf2.getText()) ;
}
File: startSearch.java
======================
class startSearch implements ActionListener {
public startSearch(String dir, String pattern) {
sDir = dir ;
sPattern = pattern ;
}
public void actionPerformed(ActionEvent e) {
....
}
}
When compiling GUIThread.java, the error I see is :
Error: unable to find constructor
startSearch(java.lang.String, java.lang.String) ;