aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes readme and package questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "readme and package questions" Watch "readme and package questions" New topic
Author

readme and package questions

kevin chang
Ranch Hand

Joined: Mar 08, 2003
Posts: 64
1 . Must I list every step compile the SOURCE files to CLASS file in readme files? What if i didn't do this?
2 . I have serval gif files for client GUI , Is it ok to package these gif in client.jar?


Sun Certified Java Programmer, Sun Certified Java Developer. <br />Strving to be a real architect.
Damian Ryan
Ranch Hand

Joined: May 09, 2003
Posts: 117
Not quite sure exactly what you mean in question 1, but for question 2, I should think it's fine to package gifs in your client.jar.
Remember if you do this to access them from your code by using Class.getResource instead of accessing the local file system directly.
For example, instead of:

use

Note the addition of a leading slash "/" to the path, as getResource takes a URL, and leading with a slash creates a relative URL (as opposed to a file path where leading with a slash creates an absolute path).
This method uses the class loader to get the resources (you can also use Class.getResourceAsStream if you want to read files, for example, properties files) and will try the JAR file first if that's where your code came from, and then the local filesystem if the requested resource is not inside the JAR.
[ May 18, 2003: Message edited by: Damian Ryan ]

Always proofread carefully to see if you any words out.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11460
    
  94

Hi Kevin,
I didnt see anything in the instructions that would indicate that I have to tell the examiner how to compile my code.
There is a requirement that I list every file that is in my distribution, along with a short description of what it is.
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
shan chen
Ranch Hand

Joined: Apr 09, 2003
Posts: 70
Hi, Damin,
Assume the help menu provides html help pages. Can these html pages be put into client.jar? How should index.html set the link to the next page in such situation? Thanks.

Hi, Andrew,
Is your assignment an old version? My assignement (new version) does not required to list all files.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11460
    
  94

Hi Shan,
Yes, I am doing the old FBNS exam, which has the following requirement in things I should submit:

A README.txt file ... that describes to the examiner the following information in exactly the order listed:
....
The names of the files you have submitted, with a note of their location in the directory structure, and a high level description of the purpose of each.

Just checked the UrlyBird (hotel) assignment, and there is nothing like this requirement in that assignment.
Regards, Andrew
Damian Ryan
Ranch Hand

Joined: May 09, 2003
Posts: 117
Not sure about hyperlinking between html pages from inside a JAR - never tried that myself.
I am sure the method I mentioned earlier would be fine for accessing the first page programatically (when the user clicks the help button/menu item) but I confess I don't know what would happen about pages linked to from that first page.
In a situation like this I usually just write some code and see what happens
Also, take a look at the swing set demo that accompanies the J2SDK. I don't know for sure if there are any html help pages in there, but if there are you can take a quick look at the source code for an answer to your problem.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11460
    
  94

Hi Damian,
You said:
Not sure about hyperlinking between html pages from inside a JAR - never tried that myself.
I am sure the method I mentioned earlier would be fine for accessing the first page programatically (when the user clicks the help button/menu item) but I confess I don't know what would happen about pages linked to from that first page.

I also havent tried it, but I can see that it should be easy to do. If you are implementing HyperlinkListener then you can handle the hyperlinkUpdate programatically so you can get all subsequent pages from the jar file sa well.
I havent done this though ... I have left the user documentation pages as regular files (once the distribution jar file has been extracted). This gives the user more flexibility, in that the can browse the help pages using their favourite browser if they want to.
Even in real life this would give more flexibility to the user: do you really want to implement bookmarks and printing and mutiple pages open simultaneously and (name your favourite browser function here) in your online help application?
Despite that, I still think an online help program is very good. It makes the application a little more turnkey ... the user just starts the app, and if they get into problems, they can click on a help button rather than trying to find where the help pages were installed.
Also you said:
In a situation like this I usually just write some code and see what happens

Since starting this assignment I have written 67 programs just to test concepts that I thought about or saw written here, before doing the real coding for my assignment. I think I have written far more test code than real code :roll:
Regards, Andrew
Damian Ryan
Ranch Hand

Joined: May 09, 2003
Posts: 117
Hi Andrew,
thanks for mentioning the HyperlinkListener. I didn't know about that - I'll add it to my inventory
I agree with what you say about not attempting to duplicate a browser's functionality in a help dialog.
I also left the user guide documentation as regular html files outside the client.jar, though I did package the gif's for the buttons and the config files (I did the old FBN assignment - still waiting to see whether I passed or failed...)
[ May 19, 2003: Message edited by: Damian Ryan ]
kevin chang
Ranch Hand

Joined: Mar 08, 2003
Posts: 64
thanks for your all warmhearted, excusing for my late come here. I got the answers. Anyway, thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: readme and package questions