Article View: borland.public.jbuilder.java.language
Article #7362How do you find/read CSV file in applet?
From: swett
Date: Sun, 24 Jun 2001 19:58
Date: Sun, 24 Jun 2001 19:58
35 lines
2340 bytes
2340 bytes
I have an applet that displays a variety of information about students
(basic info, schedule, grades, attendance, etc.) via database tables. I'm
needing to add student picture display capability, which I've been able to
do in a test scenario.
The student pictures will be JPG files, and I can load them OK as long as
they're in the same folder as the applet/class. However, I need to read a
CSV file to determine which JPG file to use for a student. A few sample
records are:
"JONES, ROBERT","09","M","157.JPG"
"WILLIAMS, SARAH","10","F","193.JPG"
"WOODLOW, JAMES","11","M",287.JPG"
I have successfully read the CSV file via a small test APPLICATION, using
File, LineNumberReader, StreamTokenizer, and StringReader objects. I've
been able to access the CSV file using an absolute file name or a relative
name (to the user.dir value).
However, even though I read somewhere that you can open/read a file from an
APPLET as long as it was in the same folder as the applet/class (or a
subfolder), I can't figure out how to do so. The applet won't run if I use
the following statement in it:
System.getProperty("user.dir")
(I was just trying to see what the user directory is when run as an applet.)
Any ideas on how I could read in a CSV file from an applet -- mainly how to
specify the path?
(The CSV file is created by a third party piece of software external to my
applet, so I pretty much need to use it.)
Thank you.
Technical Details
Message-ID:
<3b36491a$1_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!fr.usenet-edu.net!usenet-edu.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,1ed6af6867a96e3,start X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-06-24 13:11:09 PST Reply-To: <swett@bcswebsite.com> From: <swett@starband.com> Newsgroups: borland.public.jbuilder.java.language Subject: How do you find/read CSV file in applet? Date: Sun, 24 Jun 2001 15:58:23 -0400 Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 148.71.34.6 Message-ID: <3b36491a$1_2@dnews> X-Trace: dnews 993413402 148.71.34.6 (24 Jun 2001 13:10:02 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!fr.usenet-edu.net!usenet-edu.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews