File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Instructions Question : TableSorter

 
Alan Morgan
Ranch Hand
Posts: 113
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11833
181
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Alan Morgan
Ranch Hand
Posts: 113
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic