Object g = galleries.getSelectedItem(); if (g != null) { Gallery selectedGallery = (Gallery) g; username.setText(selectedGallery.getUsername()); password.setText(selectedGallery.getPassword()); } else { username.setText(""); password.setText(""); }
	public void readPreferences(PropertiesFile op) {		PropertiesFile p = GalleryRemote.getInstance().properties;		p.write();		jCheckBoxMenuThumbnails.setSelected( p.getShowThumbnails() );		jCheckBoxMenuPreview.setSelected( p.getShowPreview() );		jCheckBoxMenuPath.setSelected( p.getShowPath() );		Object g = galleries.getSelectedItem();		if (g != null) {			Gallery selectedGallery = (Gallery) g;			username.setText(selectedGallery.getUsername());			password.setText(selectedGallery.getPassword());		} else {			username.setText("");			password.setText("");		}		previewFrame.setVisible( p.getShowPreview() );		setShowThumbnails( p.getShowThumbnails() );		if (!op.getThumbnailSize().equals(p.getThumbnailSize())) {			thumbnailCache.reload();		}		Log.setMaxLevel();	}