|
The Borland documentation suggests that you should establish three directory
hierarchies:
- Where the JBuilder software is installed. For me, this is \Software\Borland\JBuilder.
- Where you do your development - that is, the location for your .java source
and your .jpr project files. For me, the root of this is \Develop\Java\Project
- Where your compiler output goes - that is, the location for your .class
files. For me, the root of this is \Develop\Java\Class
Another important factor is the use of packages. A package name is generally
supposed to be the name of the directory in which your .java file or files will
reside. You must redundantly specify this at the top of your .java source (and
the Applet Wizard will do this for you).
I generally want to have a name for the package which reflects what it does.
For instance, I called one project VariableSizeFont, and made that the package
name, and, of course, created it in \Develop\Java\Project\VariableSizeFont.
But then, what to call the applet? It would be pleasant to call it Applet. Unfortunately,
this would cause a name collision with the java.awt.Applet class. So I have
been calling it UIApplet. It seems to me the only other alternative is to not
include java.awt.*, but to have to dot into java.awt for every reference to
its content is both annoying and potentially confusing.
At any rate, I use the same name for the .java, the .jpr, and the documenting
.html. I could also use the same name for the test .html, since it goes in another
directory, but the AppBrowser doesn't show path names, so I'd constantly be
confusing it with the documentation .html. Therefore, I decided to name the
test .html TestUIApplet.html.
Now on to the problems.
You need to set the default project options to reference where you want to
put files for your projects. I remain a little confused about this, not least
since it seems that these options do not take effect until you quit JBuilder
and restart it. At this point, it seems you need to set these for the level
where the packages start - for instance: \Develop\Java\Project. Or you may have
a deeper directory structure, as I do for my examples - \Develop\Java\Project\Test\BasicJava\VariableSizeFont
being one of my packages, for instance, in which case, the default project path
would be \Develop\Java\Project\Test\BasicJava.
It seems to be best to set all this before you start a new project. You can,
however, relocate (I should say "delete and then save as") elements of your
project after it has been created. I have had the occasional crash while doing
this, but it is not clear if the relocation is the problem. Just be wary.
It is necessary to relocate the test .html since the Applet Wizard puts it
in your package directory by default.
|
|