当JEditorPane完成从url加载网页时,我如何执行操作?这有可能吗?我在网上找不到关于这个的任何东西:s
谢谢
发布于 2010-06-24 22:36:30
尝试使用PropertyChangeListener:
JEditorPane html = new JEditorPane();
html.addPropertyChangeListener("page", this);
try
{
html.setPage( new URL(webURL.getText()) );
}
catch(Exception exc)
{
System.out.println(exc);
}
...
public void propertyChange(PropertyChangeEvent e)
{
System.out.println("Page Loaded");
}有一次,该事件会在初始页面加载之后,但在所有子图像加载之前触发。但是,我刚刚做了一个快速测试,在页面和图像加载后,它现在似乎启动了。
https://stackoverflow.com/questions/3108196
复制相似问题