Reloading an Applet

Anyone know how to reload an applet in IE after changing the class files without having to close the browser window?

It should reload if you refresh IE - either <F5> or menu View/Refresh or right-click/Refresh

Similar Messages

  • Reload an applet

    how do i reload an applet, i have a button "newgame" and an actionlistener coding : stop();
                   destroy();
                   init();
                   start();
                   repaint();     
    doesnt seem to work.....

    well.....those are methods of class applet....the init is the only method i wrote and it adds to the applet some panels and buttons...do i need to overlap stop?..what do i put in stop?...(im new to java)

  • Reload Java applet

    I need to create an applet that is able to reload itself as many times as the user inputs or infinately(untill they turn off thier computer). Is there any way that this is possible?

    If I understand you correctly, you should be able to do that without reloading the applet.
    Just keep some state that says how many times the message has been shown. Before you show the message, check that state. If it's over some value, don't show the message.

  • LookAndFeel issue reloading an Applet in a Web page

    Hey all,
    I have an Applet that runs on a web page (loaded by servlets and JSP's using Tomcat 3.2.1 and Apache). I created my own LookAndFeel class and have a static function in the applet that sets the LookAndFeel to my new class. Everything works fine when the Applet is first loaded. However, when you exit the applet and then reload it, the custom LookAndFeel is gone and all I get is the default Metal. If I load the applet with appletviewer, I can reload it as much as I want and it always loads my LookAndFeel class.
    The static function is as follows
    /** Static initializer to set the LookAndFeel
    static {
    try {
    UIManager.setLookAndFeel(new MyNewLookAndFeel());
    catch (Exception e) {}
    I do not get any exceptions and like I said, everything works great when loaded with appletviewer.
    I have tried adding the SwingUtilities.updateComponentTreeUI(this); in either the start(), init(), or my own createGUI() function and it still does not work.
    Any ideas? Could this be a problem with the browser caching the applet? I am using IE 5.50.

    I have the same problem
    putting them in static doesn't keep the look and feel
    putting them in the applet constructor does'nt keep it
    putting them in init() doesn't keep it
    putting them in start() doesn't keep it
    heck, even putting them in all 4 of them together doesn't keep the look and feel, it always reverts back to metal

  • Background image/reloading/closing applet

    2 questions:
    1) How do I put a background gif/jpg image on a frame window?
    2) Is there a method or command that can restart or reload the current applet?
    3) What's the best normal way to kill/exit the applet? (System.exit() ?)
    What about browser, how do I close the applet in the browser.
    Appreciate any help.
    Regards,
    Helix
    http://www27.brinkster.com/helixical

    I think if you understand Applet's life cycle clearly you'll find answers to questions 2 and 3:
    init() - initializes the applet for the first time.
    start() - starts the applet after initialization and after every time it was stopped. (answer for your Q2)
    paint() - does the actual painting of the applet.
    stop() - stops the applet (kind of temporary), can be restarted anytime.
    destroy() - kills the applet once for all. (answer for your Q3, call this whenever you want the applet to be destroyed).
    answer to Q1, try the following:
    in init():
    MediaTracker tracker = new MediaTracker (this);
    bgImage = getImage (new URL(getCodeBase(), getParameter("bgImage")));
    tracker.addImage (bgImage, 0);
    tracker.waitForAll();
    public void update( Graphics g) {
    paint(g);
    public void paint(Graphics g) {
    if(bgImage != null) {
    int x = 0, y = 0;
    while(y < size().height) {
    x = 0;
    while(x< size().width) {
    g.drawImage(bgImage, x, y, this);
    x=x+bgImage.getWidth(null);
    y=y+bgImage.getHeight(null);
    else {
    g.clearRect(0, 0, size().width, size().height);
    happy trying...
    iDriZ

  • Reloading an Applet Window

    Hi all,
    I have an applet running inside a browser. Users login and do some work and then logout.
    This is what I want:
    When users logout I want to reload my url so that users will be presented with the applet login screen again.
    Basically, I want to call the same url from my applet when some one exits my applet.
    how would I do this ??
    Your help is very much appreciated in advance.
    Ramesh

    try
    getAppletContext().showDocument(url, "_self");

  • Reloading an applet closes Netscape 7.0 browser

    I'm loading an applet that loads an image web cam with JMF api. Everything works o.k. But after using the applet, if i go to another html page, loads it but the Netscape browser closes. I've looked at the Netscape java console and it gives me all these errors. Could anybody help me please, it's very urgent?
    I don't know how to solve this problem. Here's the code of my applet.
    import java.applet.*;
    import java.awt.*;
    import java.net.*;
    import javax.media.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class AppletSound extends JApplet {  
         MediaLocator mySound=null;
         Player soundPlayer=null;
    Component auControlComponent = null;
         String audio=null;
         public void init()
              audio=getParameter("audio");
              getContentPane().setLayout(null);
              setSize(300,50);          
         // Check that we have a valid URL and create URL object to hold it.
              if(audio.equals(""))
                   System.out.println("*Please specify one URL to play*");
              else     
                   mySound=new MediaLocator(audio);     
    try {
              soundPlayer=Manager.createRealizedPlayer(mySound);
              catch(javax.media.CannotRealizeException cre){}
              catch(javax.media.NoPlayerException npe){}
              catch (java.io.IOException e) {
    System.out.println("IOException...exiting.");
    //System.exit(1);
    if (soundPlayer == null) {
    System.out.println("soundPlayer is null...exiting.");
    // System.exit(1);
              auControlComponent=soundPlayer.getControlPanelComponent();          
              if (auControlComponent!=null)
              getContentPane().add(auControlComponent);
              auControlComponent.setBounds(5,5,295,40);
    validate();
         public void start()
              if(soundPlayer!=null)
              soundPlayer.start();
    public void stop()
    soundPlayer.stop();
         soundPlayer.deallocate();
    Here are the errors that I get from the Java Console:
    java.lang.NullPointerException
         at com.sun.media.rtp.RTCPTransmitter.makereports(RTCPTransmitter.java:225)
         at com.sun.media.rtp.RTCPTransmitter.report(RTCPTransmitter.java:129)
         at com.sun.media.rtp.RTCPReporter.run(RTCPReporter.java:215)
         at java.lang.Thread.run(Unknown Source)
    java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
         at java.util.Vector.elementAt(Unknown Source)
         at com.sun.media.rtp.RTPEventHandler.dispatchEvents(RTPEventHandler.java:114)
         at com.sun.media.rtp.RTPEventHandler.run(RTPEventHandler.java:137)
    java.lang.InterruptedException
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Unknown Source)
         at com.sun.media.rtp.SSRCCacheCleaner.run(SSRCCacheCleaner.java:157)
         at java.lang.Thread.run(Unknown Source)
    Timer: timeLoop() wait interrupted java.lang.InterruptedException
    Timer: timeLoop() wait interrupted java.lang.InterruptedException
    MediaNode event thread java.lang.InterruptedException
    MediaNode event thread java.lang.InterruptedException
    MediaNode event thread java.lang.InterruptedException

    It's me again altairforodigital, as you can see in the source code of the applet I load sound not a web image. Sorry for that.

  • Connection nullpointerexception on reload of applet

    I have the following sqlj code in an applet to retrive data from an oracle database. After this the code goes onto draw the data in the applet using AWT (that code isn't shown here).
    My trouble is that when I get to the following line Connection con = Oracle.connect("jdbc:oracle:thin:@ebalpha:1525:ORCL", "flowmanager", "xxxxx").getConnection(); I get a Null Pointer exception, but only after refreshing the applet.
    Is there something in need to add to close or null the conntection?
    So to overcap I get a NullPointerException only when I refresh the applet. It runs perfectly the first time. The applet need to be refreshed because the data in the table gets updated and the applet needs to be refreshed to show the data changes.
    public void getFlowSpaceData() throws SQLException {
    // MyIter iter;
    String strUserName = getParameter("paramUserName");
    String strFlowName = new String();
    Connection con = Oracle.connect("jdbc:oracle:thin:@ebalpha:1525:ORCL", "flowmanager", "xxxxx").getConnection();
    strQuery = "select FLOWNAME FROM FLOWMANAGER.TMP_FLOWNAMES WHERE USERNAME ='" + strUserName +"'";
    PreparedStatement pstmt0 = con.prepareStatement(strQuery);
    ResultSet rs0 = pstmt0.executeQuery();
    while (rs0.next()) {
    strFlowName = rs0.Long postings are being truncated to ~1 kB at this time.

    Just wanted to update the post that I came up with a solution. I created a sepreate thread and it now works fine, but the sqlj code does take some time to load. I was wondering if somone could take a quick look at my code and see if their is anyway I could extact the data faster.
    String strUserName = getParameter("paramUserName");
    strQuery = "select FLOWNAME FROM FLOWMANAGER.TMP_FLOWNAMES WHERE USERNAME ='" + strUserName +"'";
    Connection con = Oracle.connect("jdbc:oracle:thin:@ebalpha2.us.oracle.com:1525:ORCL", "flowmanager", "ur2c001").getConnection();
    PreparedStatement pstmt0 = con.prepareStatement(strQuery);
    ResultSet rs0 = pstmt0.executeQuery();
    while (rs0.next()) {
    strFlowName = rs0.getString(1);
    rs0.close();
    pstmt0.close();
    strQuery = "select FLOWNAME, USERNAME, PANELROW, PANELCOL, RELATEROW, RELATECOL, OBJTYPE, BASECODE, INDUSTRYID, PANELNUM, BUSINESSPROCESSID FROM flows WHERE flowname ='" + strFlowName + "' ORDER BY PANELNUM";
    PreparedStatement pstmt1 = con.prepareStatement(strQuery);
    ResultSet rs1 = pstmt1.executeQuery();
    int r = 0;
    int c = 0;
    while (rs1.next()) {
    intObjType[r][c]= rs1.getInt(7);
    strID[r][c] = rs1.getString(11);
    Long postings are being truncated to ~1 kB at this time.

  • Reloading applet

    Hi all!
    I have been searching for a while for a code that would let me reload my Applet, but I haven't found anything really. Would anyone be able to tell me if there's a code that would allow that to happen.
    It's just that I've created an Applet and there's a button whose event handler must restart the whole Applet but up to now it's not operating at all. I would be grateful if somebody could answer me this.
    Yours,
    Saulo

    All I need is to make the same graphics from the start of the Applet to be displayed once a certain button is clicked. I thought that by realoading the Applet the result would be the same... I tried to put reapeat the code I've written for the beginning on the instance where the button is but that caused me a series of errors. I wonder what that might be, as all I had were components of a paint method.
    Regards,
    Saulo

  • Browsing pages without applet reloading

    Hi.
    I'm working on a web project that has to keep the applet active over a multiple web pages.
    The applet should be active while the user is logged in. But because the reloading of the page will reload the applet, the work that the applet is doing will be restarted with the loading of the next page.
    So I hope that someone will help me to get over this problem with some advice.
    Regard.

              If you have your jsp workingDir in your WEBLOGICCLASSPATH or your JAVACLASSPATH,
              the jsps may recompile but will not reload.
              If you have your pageCheckSeconds set to -1, the page will not recompile.
              WLS is supposed to check if a JSP has been updated every pageCheckSeconds seconds.
              If you have WLS 5.1.0 sp8 or sp9, your pages may not recompile.
              Mike
              "venkatesh varma" <[email protected]> wrote:
              >
              >Hi Everybody
              >
              >Iam unable to get the jsp pages reloading automatically
              >when i request them..
              >
              >Please help me
              >thanks in Advance
              >venkatesh
              >
              

  • Frames and applet reloading

    Hello
    I have a for performance to stop my applet from reloading. I constructed a simple frameset with my applet in one and the view frame. It works fine the first time. I post out of the view to a struts configuration and to a getInputForward() to just get back with the same session but it reloads the applet. Is there a way to stop an applet from reloading if it is in a separate frame? I know I can use ajax, but would like to make this simpler approach work, if possible. tia.

    Hello
    It does work. I needed to set the input attribute and use the javascript location.reload() to update the page. It is here for some future search, or maybe not if it was so obvious, grin.

  • Applet Reloading

    In my applet I have global variables that change. Is there anyway to reload the applet at anytime so that the state of the global variables reset to their original values?
    Thanks

    why don't you just change the global values inside your applet??
    well, you could refresh a page using Javascript, and applet can talk to javascript.
    here. http://javascript.internet.com/buttons/refresh-button.html

  • Unwanted reloading Applet behavior

    I have a dynamic JTree component on an applet and as and when the user uses the application, nodes are added to or deleted from the JTree. But looks like the Applet behavior is to reload the applet everytime it is revisited or minimized/maximized, and hence the JTree goes back to the initial empty tree state. The JTree's root is initialized in the init() and every time the user adds/deletes a node, the JTree is modified to reflect those node changes. But since the applet is part of a multi-frame HTML, the applet gets reloaded each time and reverts back to its initial state.
    How can I stop the applet from invoking the init(), start() and stop() method each time? Or is the alternative to using a custom JTree Data model, one that reads its data from a Database make more sense? In that way, everytime the applet is reloaded, the JTree reads the latest data from the database and does not go back to initial empty tree state?
    Thanks for all your replies in advance!

    If your applet is reloading, then it will go back to the initial state - invokes init method. To create persistent objects, you may be better off to store the state of the object on your server as a file (object serialization) or a data base. So, that you can reload the previous state even when the init method is invoked - applet reloaded.
    But if you are just maximizing, minimizing, cover/uncover the broswer that has the JApplet with the JTree it should be able to maintain it's current state since only repaint methods are invoked and not init.

  • Reloading Applet w/ a button....

    I have a tic tac toe game i just made, it pretty much works fine, except for few minor technical errors (such as the next player text being dispalyed after a win has occured.)
    However, what I would like to do is add a button that says "Play Again". Since I know how to add buttons that part is easy enough. What I don't know, and can't find easily, is how to add code that will make the applet reload upon the button press.
    I am looking for the easiest AND most efficient way possible. Thank you.

    Well I dont understand why you cant make an endless loop inside the applet insted of reloading the applet?
    this maybe work
    URL url;
    then in the code
    do this
    try{
    url=new URL("adress of the html page");
    catch(MalformedURLException e){
    getAppletContext().showDocument(url);
    this gets the applet to call the browser to load a specific html page, if you put the same adress, it will probably reload it.
    you also need to import those to make it work
    import java.net.URL;
    import java.net.MalformedURLException;
    hope this helps

  • How do i cause the applet to reload?

    How do i cause the applet to reload?
    i have abutton in my applet "newGame" that supose to load the game again, How do i do that?, calling init again doesnt work...

    How do i cause the applet to reload?
    i have abutton in my applet "newGame" that supose to
    load the game again, How do i do that?, calling init
    again doesnt work...This is my question, too.
    At last, I kill the http process to reload a applet. It is ok. But I think it is not a good way to resolve the problem.

Maybe you are looking for