Well, this is quite a funny question. I believe that nobody dares to wear sunglasses in court, because as you can see, the court is a place of honor and justice. As a matter of fact, you should abide by the rules and try to be serious, if you really try to wear sunglasses in the court, you will be asked to take them off, otherwise, you will be taken out of the room. Trust me. Sometimes, we need to take account of the occasion and place.
Of course, you can wear sunglasses when you are in court. By wearing them, sunglasses can protect your eyes from dirt, dust and a laundry list of projectiles. As we know that sunglasses are UV protected. According to some experts, sunglasses is good for your eyes, so that it can decrease the risk of getting cataracts and other eye ailments caused by UV radiation. And the risk of cataracts, a gradual clouding of the lens of the eye may lead to total blindness, so it is essential to wear them. Also, there are many types of sunglasses which are with beautiful designs, so it can make you look cool and attractive.
Of course you can wear the sunglasses in court. You can wear it wherever you like. However you should not wear it for a long time. Or else, your ability to get adjusted to the lights environment will be decreased. You should wear the sunglasses for the cool appearance for a while.