Actually, if you need to wait for the search, I would try something like this:
public void actionPerformed(ActionEven
try{
jep.setPage("file:///c:/Se
validate();
repaint();
new Thread( new Runnable() {
public void run() {
String text = jtf.getText();
SearchBible2_1 sb = new SearchBible2_1();
sb.search(text);
jep.setPage("file:///c:/Bi
}
}).start();
}
catch(Exception e){
System.out.println(e.getMe
}
}
Main Topics
Browse All Topics





by: ShawnCurryPosted on 2005-05-29 at 10:43:42ID: 14105156
Your code runs on the event dispatch thread. That means that your window will not get repainted until this method exits, unless you explicitly repaint it. It sets the searching page just fine, you just don't see it. I didn't make up a new test, but try this:
t ae){ arching.tx t");
bleSearchR esults.htm l"); ssage());
public void actionPerformed(ActionEven
try{
jep.setPage("file:///c:/Se
validate();
repaint();
String text = jtf.getText();
SearchBible2_1 sb = new SearchBible2_1();
sb.search(text);
jep.setPage("file:///c:/Bi
}
catch(Exception e){
System.out.println(e.getMe
}
}
Also, it's bad practice to put the AWT (event-dispatch) thread to sleep.
Hope that works for you,
Shawn