Results 1 to 4 of 4
  1. #1
    sayali is offline Member
    Join Date
    Jul 2011
    Posts
    9
    Rep Power
    0

    Default How to attach a text file in your NetBeans project?

    hi,i have created an application in which an event must read a specific text file, create a new file and write to it or directly open a text(if possible word file).e.g.-i have created a text file "how to use". if i click menu in java application,this file should open.It works when i do it as a seperate java file.But fails when i jar java files and run.............

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default

    Are you jarring the text file?
    If so, are you using getResourceAsStream() to read the file?
    Stuff in a jar file are no longer Files but are resources.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default

    Have you heard of JavaHelp?

    db

  4. #4
    sayali is offline Member
    Join Date
    Jul 2011
    Posts
    9
    Rep Power
    0

    Default

    On which object we have to run this method- getResourceAsStream()?and should i directly jar a text file?How?I have added libs but never atxt file.pls help

Similar Threads

  1. Replies: 1
    Last Post: 05-04-2011, 06:04 PM
  2. Populating a JList from a text file - Netbeans
    By Ben1 in forum AWT / Swing
    Replies: 1
    Last Post: 01-13-2011, 03:30 PM
  3. Making a netbeans project into a executable jar file
    By counterfox in forum New To Java
    Replies: 3
    Last Post: 12-03-2010, 05:09 PM
  4. packing a netbeans project into a jar/exe file
    By newToJava3 in forum New To Java
    Replies: 1
    Last Post: 11-29-2010, 07:33 PM
  5. how can i attach a worg/image file
    By sniffer139 in forum AWT / Swing
    Replies: 4
    Last Post: 03-12-2010, 06:49 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
  •