Forums Register Login

Instructions Question : TableSorter

+Pie Number of slices to send: Send
Hey all,

I used the TableSorter class that can be found here

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#sorting

to allow sorting of my JTable by clicking on the column header.
I did not change the code in any way.
I noted that I did this in my choices.txt.
I believed that as it was code provided by Sun themselves then this would be ok.

But I'm starting to get worried over the following line in my instructions:

"You are permitted to use any IDE tool you choose, but you must not submit any code that is not your own work"

I'm worried about automatic failure because of this.
Anyone got an opinion on this ?
Or even better again, anyone used something like this and pass ?

Thanks,
Alan.
+Pie Number of slices to send: Send
Hi Alan,

The general recommendation whenever anyone finds a helper class that they want to use is: make it your own! That is, don't just blindly copy the code from Sun's site into your project. Read the code, make sure you understand it, then reimplement it yourself. Your reimplementation might end up looking very similar to the original, but it will be code that you are comfortable with, and code that you can describe and modify and maintain.

Regards, Andrew
+Pie Number of slices to send: Send
 

Originally posted by Andrew Monkhouse:
Hi Alan,

The general recommendation whenever anyone finds a helper class that they want to use is: make it your own! That is, don't just blindly copy the code from Sun's site into your project. Read the code, make sure you understand it, then reimplement it yourself. Your reimplementation might end up looking very similar to the original, but it will be code that you are comfortable with, and code that you can describe and modify and maintain.

Regards, Andrew



Hi Andrew,

I get what you are saying but how far do you take this ?
There are some comments missing from public methods and they would have to be added to satisfy the javadoc requirement.

Howver if I read the code now I understand it and would be happy that I could maintain it if necessary.

So I can go through it and make superficial changes for the sake of it e.g. changing variable names etc.

I guess what I am asking is how far I have to go to make it my own ?

Another example is the class comment. It describes perfectly what the class does so how can I really change this without either making it incorrect or making superficial changes just for the sake of it ?

Thanks,
Alan.
+Pie Number of slices to send: Send
I wonder if you would want to include the table sorter.
I am following the policy of Keep It Simple, as far as the GUI is concerned. Dont want to include something that is not required/essential.

But would it be nice to include the table sorter.

Also make sure you map correctly to the row_number somehow. I think the Sun example, do a sort on the JTable content level.
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 678 times.
Similar Threads
JTable manipulations
Sortble jTable
Clickable jtable header?
JTable
JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:09:34.