if (parentModel.getState() == HiViewer.LOADING_THUMBNAILS) {
if (parentModel.getState() == HiViewer.READY) {
    public void stateChanged(ChangeEvent ce)    {        Object source = ce.getSource();        if (source instanceof HiViewer) {            HiViewer parentModel = model.getParentModel();            if (parentModel.getState() == HiViewer.LOADING_THUMBNAILS) {                parentModel.getBrowser().addPropertyChangeListener(                        Browser.SELECTED_DISPLAY_PROPERTY, this);            }          }    }