Erro no JAI!

1 resposta
B

Depois de compilar o programa abaixo ao tentar executar ele exibe a mensagem : Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/jai/widget/ScrollingImagePanel

import java.awt.Frame;
import java.awt.image.renderable.ParameterBlock;
import java.io.IOException;
import javax.media.jai.Interpolation;
import javax.media.jai.JAI;
import javax.media.jai.RenderedOp;
import com.sun.media.jai.codec.FileSeekableStream;
import javax.media.jai.widget.ScrollingImagePanel; 

public class JAISampleProgram {
	public static void main(String[] args) {
		if (args.length != 1) { 
			System.out.println("Usage: java JAISampleProgram " + 		"input_image_filename"); 
			System.exit(-1); 
		} 
		FileSeekableStream stream = null;
		 try { stream = new FileSeekableStream(args[0]); } 
		catch (IOException e) { 
			e.printStackTrace(); 
			System.exit(0); 
		}

RenderedOp image1 = JAI.create("stream", stream);
Interpolation interp = Interpolation.getInstance( Interpolation.INTERP_BILINEAR); 
ParameterBlock params = new ParameterBlock();
params.addSource(image1);
 params.add(2.0F); 
params.add(0.0F); 
params.add(interp); 
RenderedOp image2 = JAI.create("scale", params); 
int width = image2.getWidth(); 
int height = image2.getHeight(); 
ScrollingImagePanel panel = new ScrollingImagePanel( image2, width, height); 
Frame window = new Frame("JAI Sample Program"); 
window.add(panel); 
window.pack(); 
window.show(); } }

1 Resposta

Leandro

O mesmo classpath que você está usando pra compilar você está usando na hora de executar??
Pois parece que o Java não encontrou a classe: ScrollingImagePanel.

Criado 3 de fevereiro de 2003
Ultima resposta 4 de fev. de 2003
Respostas 1
Participantes 2