Status about  Applet is loading

Hi,
My applet contains scrollpane and on the canvas the graphics were drawn. This applet loads on a browser. But it is taking time to load and i would like to show the status or progress bar so that user can know that applet is loading.
Thanks in advance
punni

This may help:
public void init() {   
   Container c = getContentPane();
   //create progress bar and loading label
   progressBar = new JProgressBar(0, 7);
   progressBar.setValue(0);
   progressBar.setStringPainted(true);   
   final JPanel progressPanel = new JPanel();
   progressPanel.add(progressBar,BorderLayout.SOUTH);
   JPanel panel = new JPanel(new BorderLayout());
   panel.add(new JPanel(),BorderLayout.NORTH);
   panel.add(new JLabel("<HTML><B>Loading...</B></HTML>",SwingConstants.CENTER),BorderLayout.CENTER);
   panel.add(progressPanel,BorderLayout.SOUTH);
   c.add(panel,BorderLayout.CENTER);
   doTimeConsumingStuff();
}//end init method
   * Retrieve data from the database and build and display the currently selected Map.
   * Builds a MapData object after retrieving the data from the database. Builds all
   * the panels and adds everything to the Applet so that it can be displayed.                           
   private void doTimeConsumingStuff() {
      final JApplet applet = this;
      //SwingWorker is a class that SUN programmers made. 
      //You can find its code in 'The Java Tutorial'
      final SwingWorker worker = new SwingWorker() {
         * Whatever you put in this method is meant to take awhile.  So,
         * this is the portion that is actually ran in a thread separate from
         * the main thread.
         public Object construct() {
            //do your long stuff here.
            //note, in differring locations of your time-consuming, code, do:
            progressBar.setValue(1);
            progressBar.setValue(6);
            return yourObjectRef; //this can be any object
         }//end construct
         *  Executes all its code in the event-dispatching thread.  We want
         *  the GUI building to be done in the event dispatch thread. 
         *  Because we are using SUN's SwingWorker class, we don't need to
         *  wrap the GUI building portion in a SwingUtilities.invokeLater()
         *  method.  We just put the GUI building in the finished method of
         *  the SwingWorker and it will accomplish the same thing.
         public void finished() {    
            final Container c = getContentPane(); //applet's
            c.removeAll();  //removes the progress bar
            c.add({add your components});
            c.validate();               
         }//end finished
      };//end SwingWorker class
      worker.start();     
   }//end buildMap method

Similar Messages

  • No return in JS when accessing an applet in loading process

    When I try to access a property or a method of an applet which is
    not completely loaded by the plug-in, my javascript instruction
    never returns. Not even an exception or a null. The CPU is 100% busy
    with the netscape.exe for ever. When I close the browser, I get a
    Dr. Watson.
    Context :
    Netscape 6.2, plug-in 1.3.1 or
    Netscape 7.0, plug-in 1.4.0
    My purpose is to call the applet just after everything is put in place:
    the applet is loaded, ready is work and laid out on screen. So I do
    the call on the BODY onload event. It's fine with NN4.7 or IE5.5 and
    their internal JVM because when the event fires, the applet is ready.
    The problem is with the plug-in. I know that the onload event fires
    as soon as the HTML is ready, independently from the applet which is
    taken in charge by the plug-in. The availability of the applet takes
    some time because it comes from a signed Jar from a protected area of
    the web server. So you have to walk through two additional steps:
    authentify yourself with the server (first popup) and grant session
    privileges to the applet code (second popup). During this time, onload
    has been executed. I know I have to check if the applet is up and if
    not try again later with a setTimeout().
    But how to check the readiness of the applet? When I try to read
    whatever from it too soon, the code will never return !
    To demonstrate the no-return, just put an alert and wait for the applet
    to be loaded and fully active. Then you can have a return from it.
    Don't forget: because of the user prompts (authentication and grant),
    I can't determine a time to delay the check.
    The code:<HTML>
    <HEAD>
    <SCRIPT>
    function initApplet() {
    // If you uncomment the following alert() and wait
    // for the applet to be fully loaded and running, it will be OK.
    // If you don't, "document.applets[0].isActive" will never return.
    // alert("wait")
    if (document.applets.length != 0
      && document.applets[0].isActive
      && document.applets[0].isActive()) updateApplet()
    else setTimeout("initApplet()",1000)
    function updateApplet() {
    alert("call the applet")
    </SCRIPT>
    </HEAD>
    <BODY onload="initApplet()">
    <APPLET code="test.class" width="760" height="220" name="theApplet"
    archive="theSignedJar.jar" MAYSCRIPT>
    </APPLET>
    </BODY>
    </HTML>

    I am having a very similar problem in Netscape 6.2 or later. (It never occurs in Internet Explorer) The applet can contain a few or many (in the 1000's) of applet parameters.
    I am following the same pattern to determine when the applet is loaded (by referencing a flag that is set to true through the applet), which seems pretty standard. The applet is loaded, and the flag is set, but when I begin to process the parameters, the first parameter that is examined is returned as null, even though it is included as an applet parameter in the HTML file that is generated. FYI the first parameter processed is the last one included in the source file. The worst part about this error is that the error seems random. Sometimes it works; other times it doesn't.
    Has anybody ever seen documentation as to how the parameters are loaded into memory, i.e. in what order? Does anybody know the algorithm used by the runtime system to find a parameter when a call to getParameter() is made?
    Any insight would be greatly appreciated!

  • How can i hnow the applet had load complet by javascript?

    hi,how can i hnow the applet had load complet by javascript?
    my applet load by <object> tag,
    i add a "onload" event listener to the html page's <body> tag,but the event listener is call by the page load,
    but ,the applet sometime has not loaded complet,so how can i know the applet had loaded complet!
    the <OBJECT>has some method to check the applet load status??
    3KS!

    You can have your applet call some javascript to inform that it is loaded. Make the call from your
    applet's start method
    Suppose you have a javascript function called "appletReady()"
    which sets a ready variable to true or whatever.
    Now in your start method of your applet you can do the following:
           JSObject win = null;
            try
                win = (JSObject)JSObject.getWindow((Applet)this);
                if (win == null)
                    System.err.println("JSObject window was null");
                else
                        win.call("appletReady",null);
            catch (Exception jse)
                System.err.println("Exception: " + jse);
            }Make sure you import netscape.javascript.
    And when you compile use the appropriate jaws.jar in your classpath
    It should be found under jre/lib of your JDK installation.
    I hope this helps.

  • Confusion about applet

    sir
    i have confusion about applet that if an applet compile successfully but on running it shows a exception message about "main"that no such method exist.help me out please

    The full text of the error message would make it easier for us to see what is wrong BUT it sounds like you are trying to run the Applet as an applicaiton from the comand line rather than through an HTML tag in an HTML page loaded into your browser!
    Though you can make Applets run as applications it not normal to do so.

  • How to get applet to load text file and use it

    The applet is loaded from my site and the short text file is updated by a perl script in my cgi-bin, which is called whenever someone loads the html that loads my applet.
    The text file is just a counter string and I'd like to use it to display #.gif's at a certain place on the applet window (no problem there if I can get the text file into the applet).
    How would I get the applet to load the text file into a string or array?
    It has a running thread and I'd like it to update it periodically.

    I believe you can do that with Class.getResourceAsStream.
    Or you can do it explicitly with java.net.* stuff.

  • JVM crashed when applet is loaded in browser

    when applet is loaded in browser after some time JVM crashedwith hs error log.
    i am using
    JRE 1.6.0_10,
    1GB RAM,
    XP SP3,
    IE6
    Error log
    # An unexpected error has been detected by Java Runtime Environment:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d02bd1d, pid=6032, tid=4772
    # Java VM: Java HotSpot(TM) Client VM (11.0-b15 mixed mode windows-x86)
    # Problematic frame:
    # C [awt.dll+0x2bd1d]
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

    It appears from the following statement that a native code process failed when called by the jvm.
    The crash happened outside the Java Virtual Machine in native code.Not much more can be said. The cause does not appear to Java code.

  • Java applet wont load

    There is a website on our intranet that has a window in it that is written in java. The applet loads without conflict in Windows NT, but will not load in XP. I have loaded every Java Plug-in from 1.1.1 - 1.4.1_02. I need this applet to load in XP?????????

    honestly, i find XP rather java unfriendly myself. Thats why i think running c compilers on Unix is the most feasible solution , given that most computer students would have a unix or linux platform in their labs.
    regards,
    Joshua.
    With unix, all things are possible.

  • Java Applet Wont Load Past 80%

    Someone is running a java based paint chat off of their home system, so far all of us have been able to load it all the way, except for one person who can't seem to get the applet to load past 80%.
    She says she's got the latest update for OS X and she's gotten it to load before. She's tried updating Java and restarting her system. We don't think it's a firewall, seeing as other people can access it and she doesn't think she's running one.
    Any thoughts on what the issue could be would be greatly appreciated.

    Have her go to this Sun page and test her Java installation.
    http://java.com/en/download/help/testvm.jsp
    If there's no problem, she should look for a cause other than Java/applets.
    If there is a problem, the page has troubleshooting information.

  • About applets and secure connection

    Hello. I've read some threads but I can't understand a thing about applets and SSL.
    I've a signed applet. This applets is embedded with applet tag in a jsp page.
    The applet works as a file uploader.
    With signing, the applet can access to the user file system without problem, open a connection with the server and upload files.
    Now, If I want to use HttpsUrlConnection instead of the standard http connection, what certificate does the applet use for handshake? Does the applet automatically use the same certificate used for signing?
    Thank you

    Hello. I've read some threads but I can't understand a thing about applets and SSL.
    I've a signed applet. This applets is embedded with applet tag in a jsp page.
    The applet works as a file uploader.
    With signing, the applet can access to the user file system without problem, open a connection with the server and upload files.
    Now, If I want to use HttpsUrlConnection instead of the standard http connection, what certificate does the applet use for handshake? Does the applet automatically use the same certificate used for signing?
    Thank you

  • Deermining an applet is loaded and initialized

    In the HTML of a web page how can I determine or be notified that an applet is loaded and initialized similar to "onload=foo()" on the <body> statement.
    At least in NS 7+ the <body> onload executes before the applets contained in the body are initialized.
    I also tried to use onload on the <applet> statement and while it was accepted by NS 7.1, the target JS function was not executed.

    My applets load before the javascript for the onLoad event of the body tag fires. I do the following javascript and can access methods from the applet. However, please note that the applet displays with just a loading progress bar. I cause the javascript to make the applet do the lengthy gui display rather than displaying all components on loadup. I hope this is making sense.
    //javascript
    function doOnLoad() {
       var a = document.yourAppletName;
       a.callSomeAppletMethod();
    //html
    <BODY onLoad="return doOnLoad();">

  • How to identify the status of the data load

    Hi All,
    Here is my requiremenet,
    I have a process called etl_pf2 which loads the data into staging tables. Now I have another process that does a partition exchange and moves the data from staging tables to online tables.
    In one procedure, I need to verify whether any data load into the staging tables is happings. If yes then partiontion should not occur, if no then movement should happen.
    Any idea on any parameter which can be used in the procedure to check the status of the data load in staging tables.
    Please help me.

    Thanx for reply
    But i thhink that the problem is with NQSServer which crashes but not disappears from the processes list.
    I tried to search obiee+USER_MEM_ARGS and nqsserver+USER_MEM_ARGS but found only this thread.
    How can JVM settings help to nqsserver.exe to work properly?

  • Need Help about Spatial Data Load - Mapviewer

    Hello everybody,
    I need an immediate help about spatial data load. I installed Oracle mapviwer quick start and try to work on it. However, I could not pass the load step. My questions are;
    1- Where can I find and download my country's data set (spatial data)
    2- With mapviwer, how can I load spatial data to my tables on database (Oracle). Those tables have sdo_geometry columns and I want to query location data, but could not load
    Regards,
    Dilek

    For Mapviewer questions, please post in the following forum:
    MapViewer
    Thanks

  • I have download firefox 4 beta but now in some websites can not open. applet not load properly

    I just download fire 4 beta on my windows vista. Can not open in some websites. the message applet not load properly please reload the page

    Your More system details list doesn't show the Java plugin as installed.
    Update the [[Java]] plugin to the latest version.
    *http://kb.mozillazine.org/Java
    *http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)

  • Applet not loading in some environments

    Hi,
    We have an applet that works for 99% of our users but for one user the applet does not start. Are there any specific proxy / browser settings that could prevent the applet from loading properly? Outputs from the java console for the working users show the following lines:
    basic: Applet loaded.
    basic: Applet resized and added to parent container
    basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 116394 us, pluginInit dt 399250 us, TotalTime: 515644 us
    basic: Applet initialized
    basic: Removed progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@1abab88
    basic: Applet made visible
    basic: Starting applet
    basic: completed perf rollup
    Start Method
    basic: Applet started
    basic: Told clients applet is started
    In the example where we have an issue we only see the following lines:
    basic: Loading applet ...
    basic: Initializing applet ...
    basic: Starting applet ...
    basic: completed perf rollup
    basic: Stopping applet ...
    basic: Removed progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@b51404
    basic: Destroying applet ...
    basic: Disposing applet ...
    basic: Joining applet thread ...
    basic: Joined applet thread ...
    basic: Finding information ...
    basic: Releasing classloader: sun.plugin.ClassLoaderInfo@a89ce3, refcount=0
    basic: Caching classloader: sun.plugin.ClassLoaderInfo@a89ce3
    basic: Current classloader cache size: 1
    basic: Done ...
    basic: Quiting applet ...
    It seems like for some reason its attempting to start but then instantatly stops .... we don't see any exceptions in console.
    Relatively new to applets so any advice would be appreciated

    tschodt wrote:
    What do you see with
    - a different user on the same workstation
    - the same user on a different workstation
    953875 wrote:The same user has tried different machines within the network. Another user has tried on a different machine on the same network with the same results. All machines sit behind a proxy server and browser settings are managed centrally.You are not actually answering the question.
    I deduce that
    The same user has tried different machines within the networkproduces the same behaviour.
    Another user has tried on a different machine on the same network with the same results.A different user on a different machine is not likely to tell us anything.
    All machines sit behind a proxy server and browser settings are managed centrally.So, the profile for this user may be corrupt.
    Create a new profile for this user.

  • Yahoo chess Applet not loading in Firefox

    When I am at Yahoo Games, the pop up window for Chess opens, but never loads. I tried it in IE and it works fine - so the problem comes down to Firefox.
    When I click on a games room - and window pops up and asks to punch in a code (to avoid spam). This pop up works fine, I then proceed to punch in the code and then I go to another pop up window where the Chess Game normally loads. Only now it doesn't load at all.
    it says to... Wait 3 minutes for applet to load... Click '''here''' if applet fails to load. Normally I've never had to wait 3 minutes before (ever) - now, even if I wait, it still doesn't load.
    Any help would be greatly appreciated.

    Still not working in Firefox! I can play fine in IE. I have tried everything from uninstalling java and reinstalling, clearing cache, etc... nothing works! Is there not anyone at Firefox that knows of a solution?

Maybe you are looking for

  • Big issue with decimal separator

    regional settings of machine where client & server reside are for european country (decimal separator is ",") sap b1 decimal separator is set also for ",". exception occurs when I set in code, for a edittexts' datasource of type SUM a decimal value u

  • OT: page check, please

    Here is a page I am making for a client. http://www.murraytestsite.com/unbridled/indexTBM.html Client reports that in IE6, the submenus (TabMenuMagic) do not disappear on mouseout.... Please let me know if they do for you. P.S., I know about the menu

  • HELP!!!!!!! Please look at this and try to help me...Please

    Okay I just recently got an Ipod whih is gret and all but my problem is with this Itunes I bought four shows 1 song and a video. But 2 three shows and a video only downloaded . The other four would download then start all over again.This is really ti

  • Cannot delete or re-install adobe PDF reader on n9...

    my PDF reader has stopped working for some reason but when i try to re-instal it from the download link in the phone, it says item open failed. i cannot see it listed in the App manager and when i click on the C to delete it from the menu, it says un

  • How to rewind a movie?

    Hi all, I'm making a presentation and I'm wondering how to rewind the movie? My idea is that there are a bunch of stops in this movie, and clicking will "play()" the movie till the next stop. However, I'd also like to rewind the movie to the previous