I am using
JDk version6 update 4
i excepect to read and write TIF files using applet
beacuse sun have said that can be happend .
i need it to draw + writing + edit using applet and save this as TIFF file for one off my clients.
i have pring JAI library version jai-1_1_3-lib-windows-i586
and write a demo as simple class and it work i have create TIFF file and write to and edit and insert Image to it .
when i tried to make this happend using applet i start by Create TIFF file and Signed it
all code compile well .
at running it give me applet notinited at status bar
this is error mesasge in consel.
java.lang.NoClassDefFoundError: javax/media/jai/JAI
at readFileApplet.readFile(readFileApplet.java:93)
at readFileApplet.init(readFileApplet.java:55)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.media.jai.JAI
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 4 more
Caused by: java.io.FileNotFoundException: C:\iamge\javax\media\jai\JAI.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 9 more
when i remove this line of code
RenderedOp op = JAI.create("filestore", image3,filename2, format2);
it compile well and applet be initilized and run fine
ofcourse it does not write becouse this line responsbile about writing.
i am working on winxp sp2 and IE6
snip of code
//////////////////////////////////////////////////////
String fileTowrite = "nour.tif";
String format = "TIFF";
BufferedImage jj = new BufferedImage(this.getWidth(),this.getHeight(),
BufferedImage.TYPE_INT_RGB);
Graphics2D g = jj.createGraphics();
g.drawString("Hassan Ali",10,10);
g.dispose();
RenderedImage image3 = jj;
URL filename = new URL(getCodeBase(), fileTowrite);
/////////////////??? this line makes error
RenderedOp op = JAI.create("filestore", image3,filename, format);
////////////////???
here an example at sun site it also does not work
at my browser try it .
http://java.sun.com/products/java-media/jai/forDevelopers/samples/JAIApplet.html [ March 30, 2008: Message edited by: hassan ali ]