You can use these yellow 8-32x1 1/8" carriage bolts as is for mounting the joystick on a Pac-Man, Galaxian or other metal CPs that were wood backed. As with any carriage bolts, you can spray paint the heads black if you want.
To spray paint the heads you simply push the carriage bolts through a piece of Styrofoam & prop it up outside, preferably, and spray paint them.
It's best to spray 4 or 5 thin, misty coats allowing 10 minutes, or so, between coats building up a durable, long lasting coat of paint. Allow to cure 24 to 36 hours for an even harder coat.
The best paint I found for this or coin doors, metal marquee retainers, and other black metal, even in just touching up, is Krylon Semi Flat Black.