I am using invokeLater() to load html pages within a JEditPane which is inside a JPanel which is inside a JTabbedPane.
All of my methods work fine for loading the html. The thing I am having trouble with is updating the tab title.
The methods setTitle() and setTabTitle() work however they are being executed before the PageLoader has completed. Therefore the tab title is always displaying the title of the previous html page.
Is there a way I can stop the methods setTitle() and setTabTitle() from executing until after the thread within the invoke later has completed:
here is the part of my code I am looking at:
private void showPage(){
// Load cursors
Cursor cursor = viewer.getCursor();
Cursor waitCursor = Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR );
viewer.setCursor( waitCursor );
SwingUtilities.invokeLater( new PageLoader( viewer, url, cursor) );
//Update tab title
setTitle();
tabPanel.setTabTitle(this);
//Update address bar
addressTextField.setText(url.toString());
}
thanks for any help you can give.