Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2005

Tip: Looking for answers? Try searching our database.

How to access text file?

Thread view: 
Perfect Reign - 31 Oct 2005 17:37 GMT
just added a class to a new project which access a configuration file. In
debugging the class it keeps saying the file is not present. I have it
located at the root of my package along with most of my .class files and in
the src directory.

What do I need to use to access a file from within netBeans?

I've tried this:

File propFile = new File( parmConfile);
if (! propFile.exists()) return getConfig;

and this:
File propFile = new File("/donutmon1/" + parmConfile);
if (! propFile.exists()) return getConfig;
...

Ideas?

Signature

kai - theperfectreign@yahoo.com || www.perfectreign.com

"I got a Rock!" - Charley Brown

Andrew Thompson - 31 Oct 2005 18:22 GMT
> What do I need to use to access a file from within netBeans?
...
> Ideas?

'F1' in your IDE.  If that fails, dump it and learn how to
operate the Java tools with classpaths etc..
Perfect Reign - 31 Oct 2005 19:39 GMT
On Mon, 31 Oct 2005 17:22:18 GMT, someone posing as Andrew Thompson took a
five minute break from flipping burgers to boot up the etch-a-sketch and
scribbled:

>> What do I need to use to access a file from within netBeans?
> ...
>> Ideas?
>
> 'F1' in your IDE.  If that fails, dump it and learn how to
> operate the Java tools with classpaths etc..

It says something about smartass responses not accepted.

Any better ideas?

I've done this without the IDE, in fact that's where my code is from. I'm
wondering if there's something about NetBeans that is different.  
Signature

kai - theperfectreign@yahoo.com || www.perfectreign.com

"I got a Rock!" - Charley Brown

Roedy Green - 01 Nov 2005 02:23 GMT
On Mon, 31 Oct 2005 10:39:38 -0800, Perfect Reign
<theperfectreign@yahoo.com> wrote, quoted or indirectly quoted someone
who said :

>It says something about smartass responses not accepted.

In Andrew's defense, I would hazard a guess that the posters of the
vast majority of questions had not yet read the JavaDoc or help at the
time they posted. Presumably you did.

They feel overwhelmed by the volume of it, and just can't be bothered.

The problem is, if you learn a teaspoonful at a time spoon fed to you,
it will take a very long time to learn it all, and you will wear thin
the patience of your teachers.

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Andrew Thompson - 01 Nov 2005 05:10 GMT
> On Mon, 31 Oct 2005 17:22:18 GMT, someone posing as Andrew Thompson took a
> five minute break from flipping burgers to boot up the etch-a-sketch and
> scribbled:

If you insist on having a silly attribution line,
please make it SHORT.

>>>What do I need to use to access a file from within netBeans?
>>...
[quoted text clipped - 5 lines]
>
> It says something about smartass responses not accepted.

My point is simply that your IDE is irrelevant here*.

If your coding Java, you might have a code problem, a
problem with the core Sun tools, a problem with IDE's or
tools external to Sun.

This group is only specialised to deal with the first two.
IF you have problems with external tools and packages, it
is generally wise to pursue those with whomever wrote the
tool or package.

> Any better ideas?

Do you think you've earned any more of my time?

> I've done this without the IDE, in fact that's where my code is from. I'm
> wondering if there's something about NetBeans that is different.  

No.  There is no information to suggest that Netbeans acts
in any different way (than any other IDE) to the Java core
tools as they might be operated from the command line.

So - if you can do it from the command line but not Netbeans,
either
a) You do not yet know how to use Netbeans (hence 'F1'), or..
b) You have discovered a new bug in Netbeans (which is both
very unlikely, and very not of interest to anybody but the
authors of Netbeans), file a bug report with them.

You might notice that neither a) nor b) requires you to
inform this group of your choice of IDE.

* Even if it is written by people close to/associated with Sun.
Roedy Green - 01 Nov 2005 11:58 GMT
On Tue, 01 Nov 2005 04:10:55 GMT, Andrew Thompson
<seemysites@www.invalid> wrote, quoted or indirectly quoted someone
who said :

>> On Mon, 31 Oct 2005 17:22:18 GMT, someone posing as Andrew Thompson took a
>> five minute break from flipping burgers to boot up the etch-a-sketch and
>> scribbled:
>
>If you insist on having a silly attribution line,
>please make it SHORT.

I find these sorts of attributions offensive.  They are not in the
least amusing, especially when repeated.  I consider it disrespectful
to insult people that way, especially before you have even been
introduced.

I am constantly tempted to plonk people whose only sin is using such a
an intro.

To me they all variants on: "Coprophageous X, who has the IQ of a
mature cucumber, vomited on himself, had sex with his sister, molested
a child, and then posted the following utter drivel, ha ha"

Then in the next sentence request help with a problem. Huh?  what
planet are these people from?

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Andrew Thompson - 01 Nov 2005 12:15 GMT
> On Tue, 01 Nov 2005 04:10:55 GMT, Andrew Thompson
> <seemysites@www.invalid> wrote, quoted or indirectly quoted someone
[quoted text clipped - 8 lines]
>
> I find these sorts of attributions offensive.  

I noticed.

> ...They are not in the
> least amusing, especially when repeated.  I consider it disrespectful
[quoted text clipped - 7 lines]
> mature cucumber, vomited on himself, had sex with his sister, molested
> a child, and then posted the following utter drivel, ha ha"

Now that is raising it to a whole new level.
I regard that as being deliberately offensive, as
opposed to 'silly comedy in slightly poor taste'.

Nobody who used that as an attribution line would get
any more than a 'plonk' from me.  Nor would they
deserve any more..

But.. I have seen groups (or at least a group) which had
person or persons who were so caught up on what people
put in attribution lines that I kind of became 'immune'
to all the slightly silly ones.

> Then in the next sentence request help with a problem. Huh?  what
> planet are these people from?

Yes.. I can see your point if the attribution line is
of the level you put, but in their defense, I do not feel
that either this attribution line, nor the other one
that raised some hackles recently, were *intended* to
be offensive.

[ ..and yeah, to be honest - I chuckled in both cases.
I especially liked 'boot up the etch-a-sketch'..   ;-) ]
Roedy Green - 01 Nov 2005 12:31 GMT
On Tue, 01 Nov 2005 11:15:24 GMT, Andrew Thompson
<seemysites@www.invalid> wrote, quoted or indirectly quoted someone
who said :

>Yes.. I can see your point if the attribution line is
>of the level you put, but in their defense, I do not feel
>that either this attribution line, nor the other one
>that raised some hackles recently, were *intended* to
>be offensive.

I find accusations of drug use pretty offensive, partly because people
so often use those in earnest.

On what principle are these even the tiniest bit funny?   There is no
surprise, no cleverness, no multiple meanings, no absurdity, no word
play ... just a lame insult, endless repeated.

They are like the taunts of 5 year olds.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

PerfectReign - 01 Nov 2005 16:25 GMT
> On Tue, 01 Nov 2005 11:15:24 GMT, Andrew Thompson
> <seemysites@www.invalid> wrote, quoted or indirectly quoted someone
[quoted text clipped - 14 lines]
>
> They are like the taunts of 5 year olds.

As for my tagline - it is more of a Dilbert reference. My apologies if it
or my sig - a refrence to "The Great Pumkin Charley Brown" - were
contrived as drug-related in any way.

The tagline comes from an over-abundance of posting in groups such as
alt.hackers.malicious. :)

Signature

kai
www.perfectreign.com

linux - genuine windows replacement part

PerfectReign - 01 Nov 2005 16:25 GMT
> If you insist on having a silly attribution line,
> please make it SHORT.

Oh, trust me - it is much shorter than previous and other ones. :)

>>>'F1' in your IDE.  If that fails, dump it and learn how to
>>>operate the Java tools with classpaths etc..
>>
>> It says something about smartass responses not accepted.
>
> My point is simply that your IDE is irrelevant here*.

Well, that's the reason I asked here. I thought someone might be more
inclided to have seen this.

I have the code working just fine using the CLI. IN fact, the code in
question was copied from one of the several Java classes I had taken in
the past.

As a test I wrote a new class file, using the buffered reader functions,
and everything worked great. I did the same with a fresh project in
NetBeans and all has fallen apart.

Grrr!

> If your coding Java, you might have a code problem, a problem with the
> core Sun tools, a problem with IDE's or tools external to Sun.
>
> This group is only specialised to deal with the first two. IF you have
> problems with external tools and packages, it is generally wise to
> pursue those with whomever wrote the tool or package.

Heh. Not there yet. I will be adding Derby - hey or maybe Oracle - to the
project, but I haven't gotten there yet.

Oh, here's the website linking to the project...

www.donutmonster.com

The code is all in the /stuff/code directories.

>> Any better ideas?
>
[quoted text clipped - 17 lines]
>
> * Even if it is written by people close to/associated with Sun.

Well, I figured that since it was in NetBeans and neither the online help,
Google, or my NetBeans Field Manual seem to have any indication, there
might be someone here who had run across this issue or had successfully
written a method by which one could load a properties file from within
NetBeans.

Signature

kai
www.perfectreign.com

linux - genuine windows replacement part



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.