Brian Snyder

Ranch Hand
+ Follow
since Feb 03, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Brian Snyder

Thanks Marylin,
I would like to take this a step further. So let's say I create an instance of File.
File file = new File(???);
How do I know the abstract path name to enter if the file could be different depending on the way the user installed my software?
I know it is easy to get the parent directory once a file is known, but what if where it originates (its abstract path) changes with each installation.
ie.
Some people will install as follows .... c:\Program
Some people might install as follows .... d:\Program
Maybe I need to write the starting directory in a properties file so the program can read the pathname into the program upon execution??? If so, how can I record that?
Thanks again for your help.
Brian
[This message has been edited by Brian Snyder (edited October 07, 2001).]
23 years ago
I know how to find the base directory of an applet.
ie. getDocumentBase();
but how do I determine the base directory or where all the files in a standalone application are located?
The reason I ask is that I have created a Java software program that will be installed on an end user's machine. I need the program to be able to detrmine the base directory like the getDocumentBase() function for an applet above.
It would be nice if they placed it in c:\programName...., but that may not be the case.
They may use d:\someOtherFolder\programName....
Many thanks in advance.
Brian
23 years ago
When I use the delete() command on a file, how do I get it to delete immediatly? Is is system dependent? Is there any way around it?
Many thanks in advance!!
23 years ago
I have searched this forum and the intermediate for an answer, but to no avail, I am here asking this question for which I have not found an answer.
I have created a software application written completely in java using a Win98 operating system. I have created a batch file to run that looks like this:

All the .class files and images used in the program are found in those folders. Of course, the main .class file is BaseApplet.class which is found in the c:\PhotoMate\prog folder in the package prog.
I've tested this on my machine and emailed it to others(at least 3) and it has worked on all except for one. The DOS window closed automatically after double clicking on the .bat file and nothing happens. I know that this user and the other 3 have installed the Java 1.3.1 JRE (runtime only, not the developer kit as he is only using it). I have included the classpath in the .bat file as well, and he is on WinNT. (Is that the reason?)
So....My question is....why does it close automatically? and why doesn't it run??
Many thanks in advance. A wish of good fortune to those who answer correctly.

[This message has been edited by Brian Snyder (edited October 05, 2001).]
[This message has been edited by Brian Snyder (edited October 05, 2001).]
23 years ago
Yes, he has the JRE. and yes it is looking for a .class file.
???
23 years ago
Hello,
I have created a software application written in Java. When it executes on my machine it works perfectly. I'm then putting it on a disk or zipping it up and sending it to someone else. Once they place the folder on their c:\ drive, it doesn't work. It seems as though it is not recognizing certain folders/files.
Both machines are using Windows, and both are being placed in the same folder. My C drive is just c:\. His C-Drive has a label. I think this is what is effecting the program.
How can I recognize the 'universal' C-Drive so that my program will work on any Windows OS??
Regards,
Brian Snyder
23 years ago
Hi Gautham,
Thanks for your reply. Does copying more than one byte at a time lose picture quality? Could you send me some code as well with your example so I can try it out?
Many thanks in advance.
[email protected]
23 years ago
I thought that was the case. I looked up Vector in the API which does override clone() in its method list. File does not.
Thanks!
23 years ago
Why do I get an error dtating that clone() has protected access in java.lang.Object when using the following code?

Many thanks in advance!
23 years ago

Originally posted by Brian Snyder:
[B]I've used the above code myself, but it is too SLOW!!!
I have 225 JPEG's I need copied and it takes over 5 minutes. Using My Computer in Windows takes under 1 minute.
I've used :
This is QUICK!!! The only problem is that the old file is gone. How can I just 'copy' quickly and not 'cut and paste' ?
Many thanks in advance!! [/B]


23 years ago
I'm back looking for another answer. I have 225 JPEG's that need to be copied. Using the above code takes about 5 MINUTES or more to do the job. When using My Computer in Windows it takes less than 1 minute.
There has to be an easier way.
I have used
That is quick. The only problem is that the old file obviously
gets removed. How do I 'copy' and not just 'cut and paste' my JPEGS?
Many thanks in advance!
23 years ago
Thanks Gregg..
That did make a big difference. There's still some delay, but not as much as before. Good tip. I hope to return the favor.
Brian
23 years ago
Hi Nate or whomever else.....
I am now able to successfully copy a JPEG file from one filefolder to another....BUT......
The only problem is that it is SLOW!!! I put the code used to copy the file into a thread figuring it shouldn't take away from CPU time, but I still find that the program must wait until the copying is done before the user can do something else.
Any ideas on increasing speed??? Many thanks in adbance.
23 years ago
Thanks Vinod,
I was able to fix the problem. I had a panel ontop of a panel. The panel underneath was not being 'validate()-d'. Only the one on top was. Now that I used validate() on both panels, I am .
Thanks for you help.
Brian
23 years ago
When I resize a window or move it back on screen from being
off screen, why does my 'relabeled' JLabel show the old value?
I have a JLabel with a current text label.
>I am able to place this onto a JPanel which then is placed in a JFrame. Somewhere in my program, I change the JLabel's text. When I redraw the JPanel containing the JLabel, the change appears with no problem.
The problem occurs once I minimize and/or restore/maximize the window, move the window off screen, or have another window go over it. Once one of these things occurs, the OLD Label comes back.

Many thanks in advance for your assistance. I've tried invalidate followed by validate, but the same thing keeps happening. It changes, but once the window is refreshed, the old value comes back.
23 years ago