Hi.
I'm reading Art Of Java book and I have a question about Web Crawler example...
the application has a button called "Search".
This button is associated with an event listener, actionPerformed( ) method called a private method called actionSearch( ).
actionSearch( ) tries to verify that some fileds are not blank, if not, it will call a private method called search( ).
search( ) method's logic is under a new thread like :
The first lines of run( ) method are disabling text fields and the Search button.
The author says that he used a new Thread to release the Swing event thread.
Here, I have my question :
AFAIK, we use SwingUtilities.invokeLater( ) method when we want to update or access the visual components out of the swing events thread.
How the auther is disabling swing components in a new thread ?
Is it ok ?
Thanks.
I'm reading Art Of Java book and I have a question about Web Crawler example...
the application has a button called "Search".
This button is associated with an event listener, actionPerformed( ) method called a private method called actionSearch( ).
actionSearch( ) tries to verify that some fileds are not blank, if not, it will call a private method called search( ).
search( ) method's logic is under a new thread like :
The first lines of run( ) method are disabling text fields and the Search button.
The author says that he used a new Thread to release the Swing event thread.
Here, I have my question :
AFAIK, we use SwingUtilities.invokeLater( ) method when we want to update or access the visual components out of the swing events thread.
How the auther is disabling swing components in a new thread ?
Is it ok ?
Thanks.