this is my code to get an image named "hkkl.jpg" from documents and show it on applet. but it gives error saying:
illegal unicode escape at /user and /documents....
import java.applet.*;
import java.awt.*;
public class Test extends Applet{
Image i;
public void init(){
i=getImage("C:\users\both\documents","hkkl.jpg");
}
public void paint(Graphics g){
g.drawImage(i,10,10,this);
}
}
a.html file is
<html>
<applet code="Test.class" width="200" height="200">
</applet>
</html>
Please help. I am using notepad for coding and command prompt to run it:
javac Test.java
appletviewer a.html