Why do JTable accept Vector directly and not ArrayList?

121 Views Asked by At

From my limited experience, Vector and ArrayList can be used in the same way, with the same methods (add, remove, etc)

In my school they only teach us to use ArrayList, but when we get to GUI creation, I found that the JTable constructor only accept Vectors or Object arrays and not ArrayList. Why is this the case?

1

There are 1 best solutions below

0
hc_dev On BEST ANSWER

To extend on Elliott's comment:

Reason why? Precedence or historic reasons!

Object[] arrays and Vector exist in Java since the beginning with Java version 1.0. When Sun introduced the GUI-framework Swing (which UI-component JTable is part of) to Java version 1.2 only these data-structures were available at that time.