I would suggest those colours should be chosen from an array.
something.setColor(myColourArray[i++ % myColourArray.length]);
That will of course go horribly wrong if …
this happens.
You may possibly have seen that message before; it was in response to some code surprisingly similar to yours.
Go through the
Java Tutorials about events. An action event does not depend on a mouse key, but on the GUI button being pushed. Try going through the ActionEvents which are associated with that action, and see whether you get different mask numbers from it. If you read about ActionEvent you see you can get different numbers from it. See whether you get something like ALT_MASK or META_MASK from the event. Note if those are masks, the easiest way to check for them is this sort of thing, which you can try for right middle and left buttons:-
You can tell whether the numbers are used as masks; they will be something like 1, 2, 4, 8, 16, 32, and you can find that from the constant values link.
If that doesn’t help, try coming back and considering a mouse event.
If you can work out which mask number is used, you can change the appropriate if to show your dropdown list.