Results 1 to 14 of 14
  1. #1
    vm8951 is offline Member
    Join Date
    Nov 2010
    Posts
    5
    Rep Power
    0

    Default Applet Execution Problems

    Im new to java...

    I tried to make the helicopter game, such as the one found here Helicopter Game : Max Games.

    I am using BlueJ to code it, and whenever I compile and run on my laptop, it runs great. Everything goes as plannned.

    However, when I uploaded it to my free website, I get some problems. Sometimes, the applet doesnt even load. Other times, it loads, but when the helicopter crashes there is no explosion. Also, after this happens, the applet spazzes out in many ways such as not letting my JOptionPane box going away.

    I emailed myself the code and compiled in school with BlueJ, and sometimes went wrong. I fixed this by commenting out the resize i did in my init method. Still, I dont know why resizing would be an issue on one pc and not another.

    Any help?

  2. #2
    vm8951 is offline Member
    Join Date
    Nov 2010
    Posts
    5
    Rep Power
    0

    Default

    bump^ any help?

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  4. #4
    vm8951 is offline Member
    Join Date
    Nov 2010
    Posts
    5
    Rep Power
    0

    Default

    heliextreme Applet

    it works the first time you play, but with no explosion. from then on it goes downhill and seems to get worse when you refresh the page

  5. #5
    Join Date
    Nov 2010
    Posts
    11
    Rep Power
    0

    Default

    I don't think you can resize an Applet. The browser it what sets up the size of the applet and the applet is not allowed to resize itself

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by footballHunter View Post
    I don't think you can resize an Applet. The browser it what sets up the size of the applet and the applet is not allowed to resize itself
    But you can draw the page dynamically, with an AJAX call.

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by vm8951 View Post
    heliextreme Applet

    it works the first time you play, but with no explosion. from then on it goes downhill and seems to get worse when you refresh the page
    I've check it on IE 7 and works fine, even after the refresh button. However I didn't see an explosion, but the loosing message pops up.

  8. #8
    vm8951 is offline Member
    Join Date
    Nov 2010
    Posts
    5
    Rep Power
    0

    Default

    Hmm...so I should comment out the resize(800,500); line? Re-compile and reupload? And just change the html code given to me by BlueJ to change the applet size?

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  10. #10
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by vm8951 View Post
    Hmm...so I should comment out the resize(800,500); line? Re-compile and reupload? And just change the html code given to me by BlueJ to change the applet size?
    Actually resizing works for me without a problem. And seems to me there is nothing wrong in that code. So before do any changes test the applet in a different browsers. Did you do that?

  11. #11
    vm8951 is offline Member
    Join Date
    Nov 2010
    Posts
    5
    Rep Power
    0

    Default

    Yeah I have firefox at home but I tried in school which is IE and still problem

  12. #12
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  13. #13
    Join Date
    Nov 2010
    Posts
    1
    Rep Power
    0

    Default

    i'v a problem when running applet pls help me ......
    the code for program is as follows......

    code:
    import java.applet.*;
    import java.awt.*;
    /*
    <applet code="AppStatus.class" width=300 height=200>
    </applet>
    */
    public class AppStatus extends Applet {

    public void init() {
    setBackground(Color.cyan);

    }
    public void paint(Graphics g) {
    g.drawString("this is simple applet",20,20);
    showStatus("this is status bar");
    }
    }

    when i compile its compiled.....
    but when run with appletviewer i got error as follows...
    error:
    I/O exception while reading: C:\java\appstatus.html (The system cannot find the file specified)
    but the file is at correct location....
    pls look forwrd to this problem ....
    thanx........

  14. #14
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Please don't post unrelated stuff in others thread. If your issues is not related with the discussion, please start a new thread in relevant sub-forum.
    Last edited by Eranga; 12-01-2010 at 06:10 AM.

Similar Threads

  1. problem with applet execution
    By nishant.4545 in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2009, 10:41 PM
  2. Regarding Applet Execution
    By makpandian in forum Java Applets
    Replies: 1
    Last Post: 03-13-2009, 12:49 PM
  3. External Program execution problems
    By vital101 in forum Advanced Java
    Replies: 3
    Last Post: 10-30-2007, 05:17 PM
  4. problems when I try to run an applet
    By boy22 in forum Java Applets
    Replies: 2
    Last Post: 08-11-2007, 03:47 PM
  5. problems with applet
    By paty in forum Java Applets
    Replies: 1
    Last Post: 08-05-2007, 04:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •