Home > > How to wait until html page is completely rendered

How to wait until html page is completely rendered

I use a JEditorPane to display HTML and i want to print it to an image. so i tried to load the page (JEditorPane.setPage(URL url)) and wait until the property "page" is fired. Then i printed the component to an image.
My problem is that the page wasn't completely loaded (rendered?) when i tried to print it.
Is there a way to be notified when the page is completely rendered?
thx in advance
However, you might consider setting the document property for it to be
loaded synchronously.i've already used my own HTMLEditorKit for synchronous document loading.
class MyHTMLEditorKit
extends HTMLEditorKit
public Document createDefaultDocument()
Document doc = super.createDefaultDocument();
((HTMLDocument)doc).setAsynchronousLoadPriority( -1);
return doc;
You probably already played around with calling repaint() and
validate() before printing.i tried to call repaint and validate before printing but
still it doen't work. :(
As a last resort, you could experiment with calling the printing
routine written as a thread passed to invokeLater(), although there is
no obvious reason why this would make a difference. i don't understand what i should do with invokeLater().
could you please give me a short example?
Read the other 8 answers

Related Articles

My laptop got infected with some kind of a trojan. I ran a full scan using my virus protection software, and after quite a bit of work (including a system restore), the infection seems to have been cleaned up and removed. The problem I'm having now,
Hi, as far as I see when you visit a photos page and from the overview you click to see a particular image or when on the page where all thumbnails are displayed on top and you go from one image to another the page is not completely reloaded. It just
In Selenium tests I use AdfPage.isSynchronizedWithServer to detect whether an ADF page has completely loaded. I attempted to do the same with OpenScript by doing something like: boolean loading = true; while (loading) { String[] result = web.document
When I open a page in a new tab, Firefox freezes until the new page loads completely. I can't switch tabs or do anything. It then works normally. Older versions of Firefox did not have this problem; it only started after I updated a few months ago. W
Comment traduire une page web complète avec Safari? sur PC je traduit avec Google traduction, mais il n'est pas accessible sur le iMac. J'aimerai avoir l'équivalent sur Mac : Traduire des pages web entière automatiquement.Comment traduire une page we
My settings page has completely froze up. Everything else works fine...what to do?Try reset iPad Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears Note: Data will not be affect
Hi All, This problem is irritating me and I am posting the same query for the third time here. When I come from non jsf actions such as page submitting using Javascript, clicking anchor link, clicking normal Html submit button and so on my page is no
Hi All, Basically Here is the scenario. Based on selectoin of particular service item from combo box(dropdown list), We are creating the JSF controls dynamically on new page for further process. We are maintaining the controls information in database
I saved my completed rendered video in Publish and Share as an MP4, but where is the file saved to. I set it to be saved on my desktop, but I don't see it. thanksmarkg What version of Premiere Elements and what computer operating system? You have a f
Hi, Using Adobe Pro 9 (tried with Adobe Pro 7 as well) trial version to convert EPS files to PDF. Was able to convert to PDF with no errors. We noticed that some of the pages within the generated PDF are oriented side ways, pages that need to be orie
Hi all, i have two page with names page1.jsp and page2.jsp. i open page2.jsp as pop up window by clicking a link on page1.jsp in _init() of page2.jsp,  i am getting some information from database and then i am able to create dynamic components accord
On some of the pages, I am getting this weird behavior wherein page is not rendering properly. It is showing HTML source code as is. Could you please help me out? What could be the issue? And how can we get rid of the same?Check your component jsp pa
Hello: Can someone please tell me what I need to do. When I try to access the internet from my BB I get an error message that says page cannot be rendered. Does anyone know what this means? AND what I need to do about it? Thanks so much for your help
I got a popup for an update to Firefox, which I followed to the release notes. I read and downloaded the update. When I restarted Firefox, nothing is working correctly and most pages I try to open, including the Add-On manager displays completely bla
I tried going to a site that I've never had problems loading before, and suddenly it says, "Page cannot load because the server is loading in such a way that it will never complete." or something along those lines. I've tried clearing my cookies
I own an iPhone 5 which was on 7.1.2. I updated to 8.1 on release and everything seems fine except for one major issue. Safari seems to strangely only render certain parts of pages. This is especially noticeable on pages with many images and links. S
when a page is loading, the scroll position of the page reverts to the top-left and focus in a form element is lost whenever an element or the whole page finishes loading Post relates to: Pre p100eww (Sprint)Possibly related to the OP's question, I w
A flash intro for a website's homepage starts to play before the html page elements are completely loaded and visible. The html page is not complicated so it would seem the flash is even slowing down the loading of the html and it looks bad, but not
Now before someone think I'm a complete moron, please, I know how to do that: "Save Page As... Web Page, complete". I know exactly how to do that. https://support.mozilla.org/en-US/kb/how-save-web-page I don't know when this exactly happened, i.