cp.add(jCaption, new GridBagConstraints(0, 20, 1, 1, 1.0, 0.0 , GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); cp.add(jProgress, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0 , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); cp.add(jExtra, new GridBagConstraints(0, 19, 1, 1, 1.0, 0.0 , GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
PropertiesFile pf = GalleryRemote.getInstance().properties; addComponent(cp, jProgress, 1, pf.getIntProperty(SLIDESHOW_PROGRESS)); addComponent(cp, jCaption, 2, pf.getIntProperty(SLIDESHOW_CAPTION)); addComponent(cp, jExtra, 3, pf.getIntProperty(SLIDESHOW_EXTRA)); addComponent(cp, jURL, 4, pf.getIntProperty(SLIDESHOW_URL));  sleepTime = pf.getIntProperty(SLIDESHOW_DELAY) * 1000;
	public void initComponents() {		previewCacheSize = 3;		addMouseListener(new MouseAdapter() {			public void mousePressed(java.awt.event.MouseEvent mouseEvent) {				next();			}		});		addMouseWheelListener(new MouseWheelListener() {			public void mouseWheelMoved(MouseWheelEvent e) {				if (e.getWheelRotation() > 0) {					next();				} else {					previous();				}			}		});		addKeyListener(new KeyAdapter() {			public void keyPressed(KeyEvent e) {				int vKey = e.getKeyCode();				Log.log(Log.LEVEL_TRACE, MODULE, "Got key: " + e);				switch (vKey) {					case KeyEvent.VK_ESCAPE:						Log.log(Log.LEVEL_TRACE, MODULE, "Stopping slideshow");						running = false;						hide();						break;					case KeyEvent.VK_LEFT:					case KeyEvent.VK_UP:						previous();						break;					case KeyEvent.VK_RIGHT:					case KeyEvent.VK_DOWN:					case KeyEvent.VK_SPACE:						next();						break;				}			}		});		PreviewFrame.ImageContentPane cp = new PreviewFrame.ImageContentPane();		setContentPane(cp);		cp.setLayout(new GridBagLayout());		cp.add(new JLabel(), new GridBagConstraints(0, 10, 1, 1, 1.0, 1.0				, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));		cp.add(jCaption, new GridBagConstraints(0, 20, 1, 1, 1.0, 0.0				, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));		cp.add(jProgress, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0				, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));		cp.add(jExtra, new GridBagConstraints(0, 19, 1, 1, 1.0, 0.0				, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));	}