Please use the
code button, not coloured text, because otherwise your code is difficult to read.
I suggest you find whichever book you have which recommends addActionListener(this) and burn it. If you have buttons with the names of the cars in already, you can use those names. Don’t mess around with getSource() and ==, which is non‑object‑oriented style, and potentially error‑prone.
You know you can write this sort of thing?
But what are you going to do when you have a "VW" button and a "Mercedes" button?
I think the object‑oriented thing to do is to create a CarMake class which can encapsulate the make and location. You can have a CarMake[] and you can display the name of each make, possibly with an associated number. You can create a button corresponding to each type of car. You can add listeners, and you can see from my
ColourListener class how you might do it.