import java.applet.*;import java.awt.*;
import java.awt.event.*;import com.google.gdata.client.GoogleService.*;
import com.google.gdata.client.docs.*;
import com.google.gdata.util.*;public class LoginDocs extends Applet {

public void init() {
final TextField usernameInput = new TextField("", 20);
final TextField passwordInput = new TextField("", 20);
passwordInput.setEchoChar('*');
final Label username = new Label("Username:");
Label password = new Label("Password:");
Button signIn = new Button("Sign In");

setLayout(null);
this.add(usernameInput);
this.add(passwordInput);
this.add(username);
this.add(password);
this.add(signIn);
username.setBounds(10, 10, 200, 20);
usernameInput.setBounds(80, 10, 200, 20);
password.setBounds(10, 40, 200, 20);
passwordInput.setBounds(80, 40, 200, 20);
signIn.setBounds(210, 80, 70, 20);

signIn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
DocsService client = new DocsService("Scanpoint-Documalis-v5");
String usernameText = usernameInput.getText();
String passwordText = passwordInput.getText(); try {
client.setUserCredentials(usernameText, passwordText);
} catch (AuthenticationException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}

});
}
}这是.class 文件 用 eclipse编译,通过。在appletviewer下 显示 正常 。但是 用浏览器就无法显示,ie,firefox都试过了。 经检查问题出在try {
client.setUserCredentials(usernameText, passwordText);
} catch (AuthenticationException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
这段代码中,但 不知道如何解决。以下是.html文件
<html>
<body>
<applet code="LoginDocs.class" width="500" height="300">
</applet>
</body>
</html>