How to kow when a page is complety loaded?

Hi all.
I have a JEditorPane in which I'm rendering a html page. But I want to know when the page finish to load in the JEditorPane. Is there a method, or trick to know this?
Thanks.

There are a couple ways.
(1) If you are loading the page synchronously:
(a la AbstractDocument.getAsynchronousLoadPriority() < 0), then it is done loading when setPage(URL) returns.
(2) If you are loading the page asynchronously:
Get the editor kit and wrap the kit using the Decorator Design pattern. Then set the editor kit to be the decorated one.
Make the decorated kit fire an event whenever the read() method completes. Then listen for that event, since that is when the page is loaded.

Similar Messages

  • How to detect when a page is in view with jQuery or javaScript?

    Is there a way a detect when a page is in view? Currently it seems that my document ready function is being called when the page is the next or previous page as well as the current page. Seems that this gets called twice... is there a reliable way to detect this?

    I ran into this alot. first thing is that when you are looking at a particular page, DPS is caching the pages around it, all around it, so it caches the top, right, bottom and left pages, which will launch things and play videos and what not.
    Here's the workaround for getting it to only launch when in view. set the autoplay time (I assume this is for a "webcontent overlay") to .125 seconds. it will start the clock only when the page (tile) is in view.
    don't know if theres an easier way, but that's how I do it and it works.

  • How to detect that ADF page has completely loaded with OpenScript

    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("/web:window[@title='*']/web:document[@index='0']").executeJsFunction("AdfPage.PAGE.isSynchronizedWithServer()", null);
    if (null != result && result.length > 0 && "true".equalsIgnoreCase(result[0])) {
    loading = false;
    } else {
    think(5.0);
    unfortunately this fails with
    ERROR [1] Error in section Run at line unknown. An unexpected exception occurred in the script. Script section: Run. Caused by: Exception occured.
    java.lang.Exception:
        at oracle.oats.scripting.modules.webdom.api.elements.DOMDocument.executeJsFunction(DOMDocument.java:1043)
    Anyone know how to call ADF JS from OpenScript or alternatively what is the recommended way to make sure that the ADF page has loaded completely ?

    Hi,
    when user logged in set a attribute in the session using
    sess.setAttribute("var","value");
    Now in ur JSP get this attribute if its null then ur session has expired an send the user to login page.
    sess = requset.getSession(false);
    String/Object  value = sess.getAttribute("var");
    if(value==null)
    //send it to Login page
    }

  • Knowing when a page has finished loading

    Hi all,
    I've  produced  a small project that has  a  few tabs, each tab contains an IFrame UI, which loads a BW report.
    I've been asked to  add an indicator that should tell when the reports are finished loading.
    I have two problems:
    1. How  do I know when the frame has finished loading the url? I know I can use the OnLoad tag in html, but how can I edit the HTML WebDynpro produce?
    2. What kind of indicator can I use? I thought of two options - Putting the "Progress Clock" which WebDynpro uses when calling an RFC, and for that I need to know if it's even possible  to call that clock.
    The 2nd option I thought  of is using the ProgressIndicator UI, and just divide the 100% to the number of tabs, and change the percent value when each tab  has  finished loading the URL.
    I appreciate any help  that  you  could provide.
    Yaniv

    Armin Reichert -> I've tried what you suggested about the portal integration (I send parameter to an URL Iview, which changes the url), and it works great!
    Thanks.
    Noufal Kareem -> Because I use an IFrame UI which loads a BW report, I don't have an indication (The WD don't know / care if the page inside the frame was loaded.)

  • How to make sure a page doesn't load from cache

    Hi. I have a jsp page which logs a user out, the problem is that this page gets cached sometimes and only logs the user out if i refresh the page. Is there a way to make sure that when the page loads it doesn't do so from cache ?

    Hi
    try this:
    <html>
    <head>
    <title>Your Page Title</title>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">
    </head>
    <body>
    </body>

  • When the page will be load how to make the page blank in run time

    Dear
    when i will run the page the fields shoud come with blank Field.
    i want to make it in runtime.
    example- i have one page having employees data. but when i will run that page the data will not come only blank fields should come, after thar i will create.

    duplicate how to make the page blank field in runtime

  • How to Use another JSF page that I load by XMLHttpRequest?

    Hi everyone, I'm a newbie of JSF and curisous about how to load page content seperately by AJAX.
    I saw example of Java Blue Print. It's load some data to use in page. What I want is to load another JSF page when click a link or button, (Like include another page). And work with functions privoided by loaded JSF Page.
    My example is, In a main page. I request a JSF page and set it into a div layer.
    var requestURL = "/admin/customer/customer-list-body.faces";
    var content = postDataWithoutContent(requestURL);     divContent.innerHTML = content;     
    All JSF components are required under <f:view>, thus action of form is set as "action='"/admin/customer/customer-list-body.faces'"
    But my page is main.jsp. Each time I click command button in customer-list-body.faces, the url will change to customer-list-body.faces, I want to request and hold in main.jsp.
    What can I do then? Any advices?

    Hi,
    the list doesn't seem to be your problem. You need to track down the illegal argument exception. Once you have that sorted out, expose the method on the AM so it gets shown as a method binding. The return values then could be picked up in a managed bean to create the select Item list
    Frank

  • Safari closes when a page tries to load

    Is there any other way I can go online to get help while I'm on the Mac Mini?  
    Safari opens and closes within 30 secs, never allowing a page to load.  If I click the little icon to get the multiple website list, Safari will stay open but it looks like it's the actual connecting to the internet that causes the shut down. 
    I am not familair with Macs at all, I work on PCs.  This is my daughter's Mac Mini that she's had for several years but Ange is not a computer person so I'm trying to help.  We don't have the start up discs, this computer was bought used from a friend of hers who didn't turn them over.  I am really at a loss here.  If I was on my PC, I would try to uninstall the browser and reinstall using a trial application that would be already stored in the computer.  Once I had the trial installed, I could download the entire version and I'd be done.
    Is there anything like that on a Mac?  Where should I be looking?  Help!!!

    I think the easiest option under the circumstances is to make a "Genius" appointment at an Apple Store to have the machine tested. It's a free service.
    Back up all data on the internal drive(s) before you hand over your computer to anyone. If privacy is a concern, erase the data partition(s) with the option to write zeros* (do this only if you have at least two complete, independent backups, and you know how to restore to an empty drive from any of them.) Don’t erase the recovery partition, if present.
    *An SSD doesn't need to be zeroed.

  • Download error when apps page tries to load

    The creative cloud app on my mac osx will not load the apps page, therefor I can not download any products. I have tried to re-install the creative cloud app, but it still won't work.

    follow solution 2 here, CC desktop lists applications as "Up to Date" when not installed

  • How to detect when a tile fails to load

    We currently use SSRS to generate maps w/ custom layers and data.  The requests made by SSRS to the Bing Map system occasionally fail when creating PDF versions of the reports under heavy load.  I am looking for a way to work around SSRS's limitation
    when using Bing Maps.
    One approach I am exploring is to create a system that generates my own map images using the Bing Maps Api directly rather than being dependent upon SSRS.  However, i can imaging that at some point a request to Bing Maps will result in a failure.  Either
    the system was unavailable or the request for the map tile timed out.  
    I would like to be able to detect when a tile failed to be received.

    Hi Z3M,
    Thank you for your question.  
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.  
    Thank you for your understanding and support. 
    Thanks,
    Simon Hou

  • In Pages 5 when I try to attach a pages document to an email it gives me 2 folders and 4 files ???  How does one email a pages document.

    How does one email a pages document? In pages 5 when I try to attach a pages document to a gmail email it gives me 2 folders and 4 other files to choose from. 

    Sounds like you are using Gmail.
    Pages 5 uses a zipped package of files as its format. 3rd party servers don't understand the format and show it as the component parts.
    Use Mail toenail the file or zip the .pages document before sending.
    Peter

  • HT2490 does anyone know how to get my 'google' page back when I click on safari- it was always there and now comes a panel of panes with my 'top sites'- it is so aggravating...

    does anyone know how to get my google page back when I open safari??.... it is gone and I get a full page of 'top sites' instead... it is so frustrating! appreciate the help if anyone knows!

    Safari preferences / General tab

  • How can I set the page that will open, when I open a new tab, to be the same as the homepage?

    How can I set the page that will open, when I open a new tab, to be the same as the homepage?
    An app changed it to some other search engine, before installing the app, I the tab that would open was the homepage I set.
    In my case it is Google, and I want my new tabs to open on Google like they did before the installation.
    thank you,
    Asaf Privman.

    You can middle-click or Ctrl left-click the Home button on the Navigation toolbar to open the Home page in a new tab.
    You can look at one of these extensions:
    * NewTabURL : https://addons.mozilla.org/firefox/addon/newtaburl/
    * New Tab Homepage : https://addons.mozilla.org/firefox/addon/new-tab-homepage/

  • How do I invoke an ActionListener on a page when the page initially loads?

    How do I invoke an ActionListener on a page when the page initially loads?
    Page 1: A user clicks on a h:commandButton and is navigated to Page 2.
    Page 2: When the page loads and goes through RESTORE_VIEW, APPLY_REQUESTS and RENDER_RESPONSE, I need to call an ActionListener in the managed bean for Page 2.
    However, if the user comes in from any other page than Page 1, the ActionListener cannot be invoked intially when the page loads. The user has a choice to click on the h:commandButton on Page2 to invoke the ActionListener.
    What is an example of invoking a method with the ActionListener signature in Java code?
    Where would I put the code to invoke the ActionListener, in a beforePhase or afterPhase, constructor?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Interesting. You're right. It doesn't happen when I click away from this site and then return. Maybe I'm barking up the wrong tree. Maybe it's the specific website I was thinking of and not Firefox. Unfortunately, I have to use that site all the time for work. I'll try contacting their webmaster. Thanks for your help.

  • HT1222 I just wish we had a "backwards" half circle to hit when we need to go back one page.  Does anyone else feel the same way?  How did I find this page anyway?

    I just wish we had a "backwards" half circle to hit when we need to go back one page.  Does anyone else feel the same way?  How did I find this page anyway?

    how about you just swipe from left to right.  works for me.

Maybe you are looking for