Depends if it's a 40g high or 40g long, or 40g breeder tank. Regular Dempseys get to big for a 40g, and EBJD's can reach 10" at times, my male is fully grown and is only 7" now, but my other 2 EBJD's are only 2" now. So if you want EBJD's I recommend a 55g or bigger.
i went for elecric yellows,,, colourful,, hardy and great in a tank with a blue light yube (yelloe and blue are complementary colours on the colour wheel)
I say keep it simple is a good guide to success
Jack Dempesys are definately too aggressive and large for a 40g. Stay with something smaller. The old standby convicts would fit nicely, but they also get aggressive. The Blue Acara species is a small to medium sized cichlid and they do not get very aggressive. They have colors like the Jack Demseys or Green Terrors, but are far less aggressive and stay smaller.