The word Pandemonium can be either upper or lower case. The uncapitalized term names "a tumult or wild uproar," while the capitalized version refers to "the infernal regions, or to the capital of Hell in John Milton's Paradise Lost." When Milton coined Pandemonium for his epic poem, he combined the Greek pan meaning "all, or every," with the Latin daemonium, or "evil spirit."
Although you might associate panic—meaning "a sudden unreasoning terror often accompanied by a mass flight or a sudden overpowering fright"—with the terrifying or frightening aspects of Milton's Pandemonium, the two terms are not related. Panic has its roots in the ancient Greek god Pan. Pan was credited (or blamed) for inducing the panic in the Persians at Marathon that led to their flight from that battleground.
Although pandemonium and panic may result from opening Pandora's box, there's no linguistic tie to today's third term either. That name for "a prolific source of troubles" also has its origin in myth. As the story goes, Pandora, the first woman, was forbidden to open a box given to her by the gods. Overcome by curiosity, she opened the box anyway, letting loose upon mankind a swarm of evils.