Questo il frammento di codice interessato:

codice:
		JFileChooser fileChooser = new JFileChooser();
		int result = fileChooser.showOpenDialog (Zoom.this);
		
		if (result == JFileChooser.APPROVE_OPTION)
		{
			String string = fileChooser.getSelectedFile().getPath();
			
			if (string != null)
			{
				image = new ImageIcon (getClass().getResource (string));
				setPreferredSize (new Dimension (image.getIconWidth(), image.getIconHeight()));
				repaint();
			}
		}
Ogni volta che seleziono un'immagine, viene lanciata una NullPointerException a questa riga: image = new ImageIcon (getClass().getResource (string));, come se l'indirizzo non fosse corretto... qualche idea? o_O