CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2011
    Location
    Finland
    Posts
    12

    Question Finishing applet

    Hi all,
    When I finished applet program, can I compile it as a .jar, or .war file so that its accessible via web?

    I need some files/*.txt/ to be loaded at applet start up - at the init() function, I need the applet to read the contents of the files according user preference. Is this option possible, to compile the text files together in the web archive /.war files/?

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Finishing applet

    When I finished applet program, can I compile it as a .jar, or .war file so that its accessible via web?
    A .war file is for holding the web components of a J2EE app. If you are just deploying an applet via an HTML page then use a .jar file.

    I need some files/*.txt/ to be loaded at applet start up - at the init() function, I need the applet to read the contents of the files according user preference. Is this option possible, to compile the text files together in the web archive /.war files/?
    You don't compile the text files, but you can add them to a .jar or .war file and access them from your applet.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  3. #3
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: Finishing applet

    Note on reading files from a jar file. Use the getResourceAsStream method and not the File class.
    Norm

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

Featured