我在我的Java应用程序中有一个嵌入式SWT浏览器。我想在此浏览器中直接登录到我的gmail帐户,并给出用户名和密码。我不想在浏览器中看到登录页面,我想直接转到邮件。这是可能的吗?我设置的URL是什么?它可能通过JavaScript的帮助?如何在SWT浏览器中登录Gmail帐户?
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;
public class Dummy2 {
public static void main(String args[])
{
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
Browser b= new Browser(shell,SWT.NONE);
b.setUrl("www.Gmail.com");
//b.setText("<html><body> Helllooooooooooooo </body></html>");
shell.open();
while (!shell.isDisposed()) {
//while (BGTrayApp.isOpen) {
if (!display.readAndDispatch())
display.sleep();
}
}
}