Anyway, I cannot seem to use vector methods anywhere.
Also, in my itemStateChanged and actionPerformed overriden methods, I have the definitions, but the references to the buttons are not working.
But the worst part, again, is the vector processing which is preventing me from referencing the vector.
It even crossed my mind to deep copy or clone the vector or array, and reference it that way.
Ok Ken, I have had some time to work and think on this. I cleaned up my code a little; it was just that I was making so many changes, that it became a little unwieldy to worry about aesthetics at the time.
Let me see if I can elaborate. My JCL class has a constructor for the GUI. Obviously I create the GUI. As far as a Vector to store vehicle instances, I wanted to reference outside of the GUI instance, so I though about putting it in main, which I did.
Now since I wanted to consolidate as much as I could into one class
I implemented the ActionEvent and ItemEvent interfaces, so I could make the class itself the listener. I registered the JButtons, and JMenuItems with their respective listeners.
Also, I overode, but did not fully redefine the actionPerformed or itemStateChanged methods. They are ouside of the constructor, and I thought that the class could "see" them. However, when I comile I get erros stating that it cannot resolve the references in the listener method bodies; ie actionPerformed and itemStateChanged.
Also, what I meant about the Vector methods, was using them in the said methods to manipulate, process the Vector with the built-in methods when a user adds, removes, or sells a vehicle instance.
I could not understand your explanation for this.
I know that a Vector and Array are not the same, just like an ArrayList or LinkedList. I commented most of the stuff out, but your can't tell in HTML format.
I kept some of the commented out code to annotate my changes, and to keep "residual" code, just in case my changes did not work. I wasn't sure whether to create my vector in main, in the constructor, or somewhere in the JCL class.
The latter is what I thought would be best but I could not make it happen. Where would I declare the list? Before the constructor?