How do you add/remove elements from the Vector?
Don't you have to do that programatically?
So... You know WHEN it is happening, why would you need a listener?
A listener "listens" for events that you don't know when they will occur.
(Like a user; pushing a button, checking a box, or selecting a radio button)
I think you will have to wrap the Vector (or extend the Vector class) in your own class that implements an addListener(...) method and overrides add() etc to broadcast the change event forwarding the change to the the Vector.
This is basically what javax.swing.DefaultListModel does to support JList objects - you may find that a javax.swing.DefaultListModel is all you need.
Yes, that explanation clarifies it. DefaultListModel sounds ideal - it supports a Vector-like data model and was designed for the JList GUI component to track its changes, but the Listener design pattern it uses will work for any other class that wants to know about changes. I doubt you will find a (much) better solution.
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...