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

[1049 byte] By [yuvaraja] at [2007-10-2 11:08:05]
# 1
HiI think in which directory yr screen...... file is present from whereu r running ur applet filegive the absolute path in file constructortry this
skpmcaa at 2007-7-13 3:45:11 > top of Java-index,Security,Signed Applets...