This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 45780 - Newb's issues - file i/o chapter in my book
Summary: Newb's issues - file i/o chapter in my book
Status: CLOSED INVALID
Alias: None
Product: obsolete
Classification: Unclassified
Component: applet (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P4 blocker (vote)
Assignee: Martin Grebac
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-01 06:01 UTC by ArmchairAthlete
Modified: 2004-08-13 12:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ArmchairAthlete 2004-07-01 06:01:49 UTC
I'm a beginner to Java, Netbeans, and programming 
in general for the most part. Netbeans seems 
pretty nice, but I ran into a bit of trouble when 
I started trying to compile/execute the examples 
for the file i/o chapter in my Java book 
(straight from CD). My problems don't occur when 
I execute from the command line or execute with 
other editors. The book is Java Software 
Solutions by Lewis & Loftus (I'm spending some 
time this summer to get ahead before I start CS 
classes in the fall at the Georgia Institute of 
Technology). 

Some problems with Netbeans:
-Programs creating files in the Program 
Files/NetBeans3.6 folder instead of the folder 
they are located in
-Programs not being able to find/read files 
located in their own folder UNLESS the entire 
filepath is specified in the source code
-Applets that use images located in the same 
folder as the applet working correctly in web 
browsers, but ONLY when the full file paths of 
the images are specified. They won't work in IE 
without the file paths being specified, and won't 
run with Applet Viewer in Netbeans no matter what 
(security exceptions). 

Exception in Netbeans even when the applet does 
specify where the image it wants is:

java.security.AccessControlException: access 
denied (java.io.FilePermission C:/Documents and 
Settings/Administrator/My 
Documents/Java/examples/chap08/arrowUp.gif read)

That applet works fine in a web browser with the 
file paths specified!

I do know that applets are supposed to run in 
a "sandbox" so that they are appropriate for use 
on a web page (can't do malicious stuff). I'm not 
that huge of a newb, heh. These are applet 
examples from the book (this edition is late 
enough that the authors used Java 1.4 too). 

So.... 
1) How can I get Netbeans to stop behaving like 
this when dealing with files?
2) Is there a method to return the filepath of an 
object? (Can a program "know" where it is on the 
hard drive and return that?)
Comment 1 ehucka 2004-07-12 10:17:13 UTC
reassigning to applet
Comment 2 Martin Grebac 2004-07-12 10:37:15 UTC
Please, Netbeans issuezilla should be used for bugs in the IDE, not
for development questions. Those you can ask e.g. here:
http://forum.java.sun.com/

http://java.sun.com is always a good source of information with
tutorials, docs, forums and other stuff - I'm sure you'll find what
you need
Comment 3 ArmchairAthlete 2004-07-13 02:02:53 UTC
Doh, sorry.... They told me on the SUN forums to look for the 
Netbeans forums. I guess this isn't it. I'm getting by OK anyhow.