Wikipedia says that 787s have a production cost of around $100 million per unit, and that the unit cost of purchasing one is somewhere between 200 and 300 million, and that Boeing expected breakeven at around 1000 units sold.
The unit cost of a F-35 is currently in the 100-150 million dollar range.
The 1.5 trillion dollar cost quoted is for the total program life - that's the cost purchasing, operating, maintaining, and upgrading a fleet of over 2000 aircraft over nearly 50 years. Of that, 1 trillion is in operating and sustainment costs. Total R&D and Test/Evaluation costs are estimated to finish up somewhere around 60 billion dollars, which compares favorably to the estimated 32 billion that Boeing spent before the first 787 order was completed.
But as stated elsewhere, that isn't porky enough.
The F-16 isn't stealthy (terrible in fact), and the F-22 isn't well suited as a strike bomber - its weapon bays are too small.
In fact, the F-35's single engine design works well in providing enough space for weapon bays, while still keeping the aircraft fairly compact.
The F-16's airframe is fine, but not stealthy. Stealth is crucial when it comes to taking out the tracking radars of most "strategic level" SAM systems (like the S-300 and S-400). The F-16, with its inability to carry stores internally, shines like a beacon to these SAM systems and can't get close enough to take them out without huge amounts of support.
Thus, the F-35.
I don't know why I was downvoted with no good counterarguments.
It's like comparing the cost of a bus vs a tank.