Hello,
I'm having a problem with edtftpj in Java applets as well. I added the permissions to the policy file and I have a trusted java applet, but it still doesn't work. If I add the line with "ftp = new FTPClient("localhost");" to the code, then it says that my applet hasn't inited. If I take it out, it draws text to the screen as shown in the paint method.
Here is some of my code:
public void init() {
String str_file, str_dir, str_new_name;
int j;
Button test_but;
Panel pane;
try {
Frame parent = new Frame();
FileDialog fd = new FileDialog(parent, "Please choose a file:", FileDialog.LOAD);
FilenameFilter fnf = new EndsWithFilter(getParameter("FileFilter"));
FTPClient ftp;
drawGrid();
fd.setFilenameFilter(fnf);
fd.setFile(getParameter("FileFilter"));
fd.show();
str_errorcheck = "test1";
str_file_name = fd.getFile();
str_dir = fd.getDirectory();
str_errorcheck = "test2";
ftp = new FTPClient("localhost");
str_errorcheck = "test3";
/*
ftp.login("test", "testing");
str_errorcheck = "test4";
str_new_name = "temp" + getParameter("Login") + ".out";
ftp.put(str_file_name, str_new_name);
str_errorcheck = "test5";
*/
}
catch (Exception e) {
}
finally {
}
}
public void paint(Graphics g){
String url, str_string, string1;
Connection con;
Statement stmt;
ResultSet rs;
int j;
InputStream f0;
try {
getGraphics().drawString(str_errorcheck, 10, 80);
}
catch (Exception e) {
g.drawString(e.getMessage(), 0, 200);
}
finally {
}
}