简体   繁体   English

如何检测网页已在Java中加载

[英]How to detect a webpage HAS been loaded in java

I am using the following code to display a webpage: 我正在使用以下代码显示网页:

      String downloadURL="http://in.finance.yahoo.com/echarts?s=%5ENSEI#symbol=%5Ensei;range=1d;compare=;indicator=volume;charttype=area;crosshair=on;ohlcvalues=0;logscale=off;source=;";
        java.awt.Desktop myNewBrowserDesktop = java.awt.Desktop.getDesktop();
        java.net.URI myNewLocation = new java.net.URI(downloadURL);
        myNewBrowserDesktop.browse(myNewLocation);

Now , i want to detect when the page has been fully loaded. 现在,我想检测页面何时已完全加载。 ( The wait dialog is to displayed till then ). (到那时将显示等待对话框)。 How to do i go about doing that? 我该怎么做呢? Thanks in Advance 提前致谢

I'm afraid you can't. 恐怕你做不到。 Once you call browse(), if all goes well, the operating system takes care of launching the URI in the default browser and there is nothing (like a handle) returned to your application so it's not possible. 一旦调用browser(),如果一切顺利,操作系统将负责在默认浏览器中启动URI,并且没有任何内容(如句柄)返回到您的应用程序,因此这是不可能的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM