Applet File search
Hai
give some solution to find correct path using applet
below give is the applet code ,when i run this using IE ,path found is to be incorrect ,how to solve this problem
import java.io.*;
import java.applet.*;
import java.awt.*;
import javax.swing.*;
/*<applet code ="Appdemo" width=300 height =50>
</applet>
*/
public class Appdemo extends Applet
{
public void start()
{
java.io.File file1=new java.io.File("Screen.java");
System.out.println(" Path "+file1.getAbsolutePath());
JOptionPane.showMessageDialog(null,"path1"+file1.getAbsolutePath());
}
}
The above is the applet file
when i run this applet by
appletviewer Appdemo.java i am getting the correctpath as (D:\sample\Screen.java)
same thing when i run this applet in InternetEx
i am getting path as
c:\Document and setting\user\Desktop\Screen.java
how to solve this i need to get the same path as D:\sample\Screen.java

