Results 1 to 3 of 3
  1. #1
    cjcj1949 is offline Member
    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0

    Default Packaging an extra file and then using it from the jar file

    My java program for a pc uses a text file. I've included it in my jar file, but I cannot find out how to read it from the jar file when I click on it. If I put the text file in the same directory as the jar file it works.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default Re: Packaging an extra file and then using it from the jar file

    Check out this tutorial: How to Use Icons (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)

    It's for image files, but the principles are the same.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default Re: Packaging an extra file and then using it from the jar file

    Quote Originally Posted by cjcj1949 View Post
    I cannot find out how to read it from the jar file when I click on it.
    Eh, wait, click on what?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 0
    Last Post: 05-24-2012, 08:37 PM
  2. Replies: 15
    Last Post: 02-16-2012, 03:43 PM
  3. Reading extra /n on file.
    By gicp89 in forum New To Java
    Replies: 9
    Last Post: 02-08-2011, 12:48 PM
  4. Replies: 0
    Last Post: 02-11-2009, 09:53 AM
  5. [SOLVED] File I/O Extra Credit Assignment FTW!
    By Bascotie in forum New To Java
    Replies: 9
    Last Post: 06-10-2008, 08:20 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
  •