How Can I access a file within that is part of my jpx

The file is part of my JPX but I don't know how to access it.
I use the following code for images
ImageIcon backImage = new ImageIcon(OpeningUI.class.getResource("myImage.gif"));This doesn't work.with BufferReader because the constructor doesn't accept a URL
if I use this
BufferedReader input = new BufferedReader(new InputStreamReader(
            new FileInputStream("Agreement.txt")));I get this FileNotFoundException:
Agreement.txt (The system cannot find the file specified)
Please Help
thanks.

I'm getting a NullPointerException now.
Agreement.txt is definatly part of my JPX.
Here's the Code if it will help
private void readFile() throws FileNotFoundException, StreamCorruptedException, IOException    {
        BufferedReader input = new BufferedReader(new InputStreamReader(
            new FileInputStream(getClass().getResource("Agreement.txt").getFile())));
            //new FileInputStream("Agreement.txt")));
        //DataInputStream input = new DataInputStream(new FileInputStream("Agreement.txt"));
        boolean bEof = false;
        String sDisplay = "";
        do  {
            try {
                sDisplay += input.readLine();
                System.out.println(sDisplay);
            catch(EOFException eofe)  {
                bEof = true;
                System.out.println(eofe.getMessage());
            catch(IOException ioe)  {
                bEof = true;
                System.out.println(ioe.getMessage());
        }while(!bEof);
        txtAgreement.setText(sDisplay);
        input.close();
        System.out.println(sDisplay);
    }

Similar Messages

  • How can we access the file/directory system in the server

    Hi friends,
    I have made a text editor attached with an audio player for my project.
    Both text editor and audio player are implemented in applet and put in to a
    jsp page using jsp:plugin. Text editor and player are separate applets running
    in the same page and from same server.A client who is using this editor may
    want to save the edited text files to the server as well as hear audio files from
    directories in the server.
    My question is how can we access the file/directory system in the server
    like we do in the local machine.When the user cliks save or openfromserver button
    in the editor, folder/files in the server must be displayed as we do with FileChooser.
    I am using Apache Tomcat 5,wiindows 2000 server, jdk1.5.
    manu

    You can't access it directly. But your applet can make net connections to the server, and the server can provide that kind of functionality. Generally this is easiest by making HTTP connections and having the server provide the functionality via the web server. (So in your case, JSPs or servlets on the server would list/deliver/create/modify/delete files, and the applets would invoke those JSPs and servlets.

  • How can I access video file from sd card on ipad2?

    How can I access video file from sd card on ipad2?

    Your iPad 2 will see the video if:
    It's in a DCIM folder on the top level of the card (which is how most cameras do it)
    It's name is 8 characters, no more, no less (CKDI9483 for example)
    It's a format that the iPad will play
    I've made mp4's of things, folderized them right and named them 'right' and can transfer them to my iPad, so you can use a computer to make the files conform to what the iPad will see.

  • How can i access the stepname within a steps post-expression?

    How can i access the stepname within a steps post-expression?
    i only saw the step-id of the step: Step.TS.Id
    is there a pssibility to get the stepname from the id?
    thank you!

    Hi Fischer,
    use the expression NameOf(Step).
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How can I access my files from iCloud drive

    How can I access my files from iCloud drive from my iPhone? Is there someway to access the data like other cloud app as Google Drive nad Dropbox.

    You access them with the App responsible for the type of file.
    Read through this: iCloud Drive FAQ - Apple Support

  • HT4859 Can't access my files uploaded to iCloud, yet iCloud shows 2 out of 5 gigs used. How can I access my files?

    I recently had an issues with my old iPhone 4s. I took it in to the apple store but the night before made sure I backed up my files to iCloud. After doing so I made sure my files were backed up because it went from 0 of 5 gigs to 2 of 5 gigs used. When I got my new phone, also an 4s, I tried to recover my contacts and pictures from iCloud, yet nothing happened. When I logged into icloud.com it shows no old contacts, actually none at all. I also can't figure out how to access my old pictures and files on icloud.com. When I go to icloud's settings on my iPhone it clearly shows 2 gigs of files yet when I try to restore the files to my new phone nothing actually gets added to the new phone. How can I access these files???? Anyone have any idea??

    just tried restoring from backup and it didn't list it as one of the backup options after i wipe out the iphone yet for some reason it shows up when i go through settings>>>manage storage. thanks anyway. i may have to bite the bullet and sit and wait for a few hours at the apple store, argh...

  • How can we access a file that is on a mapped network drive.

    If I have a network drive that is password protected and is already mapped on a server(x.x.x.x) as R drive. And I have file called temp.txt on R:\Temp folder on the mapped network drive.
    How can I access it using file: using a client application running on that server.
    Thanks.

    ag2007 wrote:
    When I use it the above way I am getting the following exception:
    java.io.FileNotFoundException: \\network\share\Temp\temp.txt (Logon failure: unknown username or bad password).
    From the above I can say that I need to specify the username and password.
    Now my question is how do I specify the username and password in the URI?
    Thanks for the help.You don't. It is required that the user account running the code already has permissions to the directory in the first place.

  • If I preformed a factory restore, and didn't restore from time machine, how can I access my files that were backed up?

    I wiped my Mid 2009 MBP and decided not to restore from time machine backups but now I need access to a few of the files from the pervious backup, how do I access those files? The previous backups are purple and inaccessible from the time machine window.
    Details: I use a G Drive to do my Time Machine backups.

    While in Time Machine, press the key combination shift-command-C. The front window will show all mounted volumes. All snapshots should now be accessible. Select the one you want and navigate to the files you want to restore.

  • TS3972 How can I access the files(movies,music,etc) in my Apple Time Capsule(4th Gen) from my Apple TV(3rd Gen). This is very frustrating Apple has not provided a basic feature, and me buying the Time Capsule and Apple TV is an complete waste of bucks.

    I have an Apple TV (3rd Gen) and Apple Time Capsule (4th Gen). How can I access Movies and Music stored in the Time Capsule from Apple TV. This is very  n't give frustrating that Apple doesn't give their customers with an straight forward access to their customers in between their own products. Iam repenting that buying these products is completely waste of bucks. Appreciate your help...

    Welcome to Apple Support Communities
    The Time Capsule is clearly announced as a router with a hard drive to make backups, not to store anything and share it with your Apple TV.
    To access to movies and music from the Time Capsule, note that the Apple TV can only access to them if they are stored in your iTunes library, so you will have to put your movies and music into iTunes to access to them, and then, put your iTunes library on the Time Capsule in order to access to your data from there

  • How can I access a web site that is blocked?

    The website listed below is blocked. How can I access it?

    https://webinar.cms.hhs.gov/e13581911/event/event_info.html <br />
    Loads for me. What indication do you get that it is blocked?

  • Iphoto and itunes files disappeared when i upgraded to os mavericks. How can i access these files?

    iphoto and itunes files disappeared when i upgraded to os mavericks. How can i retrieve these files? Time machine is not opening my backup files on an external Lacie HD.

    Apple keeps books for a short time (used to be 40 days. I've not seen a recent time frame)
    What version did you have?
    Books do nor exist except in the iPhoto database so you can not "find" a book vista TM. You restore a previous library (be sure NOT to overwrite your current library) and switch to it
    LN

  • How can I access the files on my time capsule?

    I bought this thinking it could be used as additional storage, like a hard drive only wirelessly.  It appears to be functioning as backup but I don't know how to access the files to see if it actually is.  Any advice?  When I click on time machine in the finder it just takes me to a folder that says Data with no entry for date modified.  Yet elsewhere it tells me it has been backing up every half hour or so.  Whats the deal?

    You do not access the backup file store directly.. you access it via Time Machine.. the files are not stored in a way you would directly access anyway.. all files are stored as a backup in a very complex structure.
    Read Q14-17 on how to use restore to get files out of the TM backup.
    http://pondini.org/TM/FAQ.html
    If you want to access files on the TC, copy them directly to the TC .. don't use backups as a method of access to other devices.

  • How can I access windowsxp files while running firefox 3.6?

    I have WindowsXP installed and use Firefox 3.6 to interface with my computer. Occasionally I need to access run Windows XP. My question is how can I go from Firefox to Windows XP and then go back to Firefox?
    Thanks very much.
    Sid

    Firefox is not an interface for the computer, it is just a web browser.
    You can close Firefox by selecting File > Exit, and restart Firefox by clicking on its icon. With Firefox open, you can use the Windows task bar to switch to other applications. You can also minimize Firefox by clicking on the minimize button in the top right of the Firefox window.
    For help on using Windows XP, Microsoft have some support documents available at http://windows.microsoft.com/en-US/windows/help/windows-xp

  • SharePoint Workspace: How can I access synced files in Office Document Cache?

    I have the following Scenario and I'm struggling on the Office Document Cache, I hope someone can help.
    * Document Library / SharePoint Site on SharePoint Server 2010 holding PDFs, Office Documents, videos etc.
    * We use SharePoint Workspace to sync the document library to Windows 8.1 Enterprise Clients and keep it up to date
    * This works fine so far. All documents are synced to the Clients and are stored in the Office Document Cache.
    * Now the problem: we want to build a Windows 8.1 Modern UI app that lists all documents stored in the Office Document Cache. We already built a similar app that is able to list normal folders stored in the Windows file system... but we can't find a
    way to do that with documents stored in ODC.
    Is that even possible and if yes, how can we do that? Are there any APIs or methods that we can use?
    Many thanks for any answer!

    Hello jh-work,
    Maybe you can find something in the SharePoint Workspace 2010 SDK:
    http://msdn.microsoft.com/en-us/library/office/hh300578(v=office.14).aspx
    - Dennis | Netherlands | Blog |
    Twitter

  • How can I access onenote files from the iPhone?

    Hi there,
    I would like to explore the method of manually and regularly moving onenote files from my iphone to my PC so that I can view them on my PC.
    Is this possible? If so, can anyone please tell me how?
    I'm thinking this will require copying a file or something from my iPhone to my PC, but how?
    Thanks

    I wouldn't hold you breath. I understand what you say you want to do, but that is going in exactly the opposite direction that the industry is moving.
    Using MS's cloud based sync is not an "extra step". It reduces the effort to keep things synchronized on your part to nearly zero.
    If there is no 'trust issue' there, as you seem to imply, then it seems you are simply trying to complicate your life by refusing to use the application the way it was designed to be used.
    One Note isn't anywhere near being 'one of a kind'. It's one among many, and not a very good one at. It's bloated, slow, and cumbersome.
    Investigate other options, or use it the way it's meant to be used, but hoping that Microsoft will move in the direction you want to go is pretty much pointless.
    Tools like File Explorer can often do more harm than good. you were never intended to have access to the file system on the phone. One wrong move can really screw things up.

Maybe you are looking for

  • Problem to send a message with JMS

    Hi I'm doing some tests with the api JMS to know how works. I have got some problems. I have been looking for some information but i don't find so much. I have got too doubts. I am usinng Netbeans 5.5 with Sun Java System Application Server Platform

  • Time Machine backups still on drive, no longer in Time Machine

    I have two computers backed up to the same drive, and I cannot backup Mac#2 because the backups of Mac#1 are taking up too much space. On Mac#1, I went into Time Machine and used the Delete Backup option on several of the oldest backups. I ran into o

  • Syntax of jpa query

    Query query = em.createQuery("select of from employees o where o.status : = status and o.lastName LIKE 'lastName%'"); query.setParameter("status", "A"); query.setParameter("lastName","Anne"); when i try to run the program with this code, I get the fo

  • View photoshop alpha channel

    I am working with Final Cut Pro 5 by Larry Jordan, p. 402, Creating a Traveling Matte. He says to double click a tiff file and load it into the viewer. In the book the transparent checker board appears behind a white snowboarder in the Viewer. (It is

  • Hardcover Book Print Quality = Very Poor!

    In the past with iPhoto 4 & 5, I have ordered and recieved hardcover books of very high print quality. I have just recieved my first hardcover book using iPhoto 6.01, and the print quality is down right poor and unacceptable. My high resolution shots