Hi ZhengQi,
There are many code conventions that
you should be aware of for this assignment. To view those conventions, click on the link of my first post.
To download the HTML version click the following link:
Java Code Conventions (Download HTML) Here are some examples:
Don't do this:
Do this instead:
Don't do this:
Do this instead:
Never have lines over 80 characters. If you have to break up a long line of code, there are guidelines to where to break the line and many other items to make code very easy to read.
And another question:why can't use Vector here?Which Collections should I take???
Vector is one of the old Collections objects and the newer ones are now preferred. A good choice for a table model would be an ArrayList which has both the functionality of a dynamic array like Vector and implements the List interface. You could also use a HashMap by mapping a row to a record.
Hope this helps,
Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher