The F-18 and F-22 both fly in a pretty nasty environment... and both have more than 20% of their structural material made from composite material.
50 percent of the Dreamliner is composite, including major structural elements like the fuselage, wings, and tail. One seats 1 passenger, the other 300. The 787’s pricetag is $150 mil per plane, the F-22 is currently running $361 mil per plane. I hope the disparate prices reflect the F-22 being a more robust airframe, although I doubt it.