Results 1 to 10 of 10

Thread: [RESOLVED] applet problem

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Resolved [RESOLVED] applet problem

    i've made a project, i want to test this code:

    Code:
    String cmdlocation = "c:\\program files\\Mozilla Firefox\\firefox.exe";
    String gweb = cmdlocation
    try {
    Runtime.getRuntime().exec(gweb);
    }
    catch(IOException ioe){
    System.out.println("Did not work");
    }
    and well, it works... but when i jar the file and add the jar to a html file, it doesnt work in the html file, but the jar file works opening with a batch file.

    does anyone know how to fix that?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: applet problem

    What do you mean "doesn't work in the html file"?

    What does it do in the html file? Are you getting errors?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: applet problem

    well, i don't know if i have the rights to post it, so i wont post it, but if you want to try it should i pm you it?

    i don't really know how to explain, but i will try...

    i made a jar file out of my project and it worked perfectly, but when i added the jar file to my website, it didn't work. just like the buttons had no code in them...

  4. #4
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: applet problem

    Was this always run in an applet or did you run the code in an IDE (and it worked) and then put it in the applet and it didn't?

    I'm not really sure, but I would imagine that an applet wouldn't have the permission, by default, to access and run programs on your local machine.

    Check your java console to see if any errors are output.

  5. #5
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: applet problem

    Does your class extends java.applet.Applet or javax.swing.JApplet?
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: applet problem

    import java.applet.Applet;

    yes.

    sorry for my late reply.

  7. #7
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: applet problem

    And you can see the applet in your html?
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: [RESOLVED] applet problem

    thank you Computerjy for helping me.

    it helped alot, but strange enough i got a error when it was _Blank but when it was _Top it worked.

  9. #9
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: [RESOLVED] applet problem

    What error?
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: [RESOLVED] applet problem

    the code you pmed me, i pmed you that i got a error. and well, igot it working.

Posting Permissions

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



Click Here to Expand Forum to Full Width