That's true, but the justices are aware of public opinion, and they very rarely go against it. The Second Amendment is approved by about 70% or more of the public in at least two fairly recent polls.
I believe they're aware of public opinion as presented to them via the media and their personal associations. That's another reason to get the government out of DC and scatter it across the nation.