There are two things a company can do that are guaranteed to make investors happy. One is to make a lot of money. The other is to give a nice chunk of that money back to shareholders in the form of dividends. When a company does both of those things, its stock is likely to be quite popular.

Apple (AAPL -1.22%), Microsoft (MSFT -1.27%), and Johnson & Johnson (JNJ 1.49%) check off both boxes. These aren't just solid dividend stocks; they're also practically minting money.

U.S. hundred-dollar bills roll through a printing press.

Image source: Getty Images.

Apple

Apple claims the highest market cap of any company in the world. The technology giant generated free cash flow of $51.2 billion over the past 12 months. It's not surprising, therefore, that Apple sits on a cash stockpile (including cash, cash equivalents, and short-term marketable securities) of nearly $77 billion. The company also has long-term marketable securities worth almost $185 billion. 

After going 17 years without paying a quarterly dividend, Apple resumed its dividend program in 2012 -- primarily because it had so much money it needed to do something constructive with it. Apple's dividend currently yields 1.62%. That's on the low end of where the company's yield has been in recent years, but for a good reason: Apple stock is up 35% so far in 2017.

Since resumption of the dividend program nearly six years ago, Apple's dividend has increased by 66%. Expect the dividend to keep on going up. Apple uses less than 27% of earnings to pay dividends. 

But is Apple still a good stock to buy? Some would say it isn't, because of the maturity of the smartphone market and Apple's share price near all-time highs. My view, though, is that Apple will continue to put its enormous cash flow to good use, with the stock remaining a solid pick for long-term investors. 

Microsoft

Microsoft's market cap of around $600 billion isn't quite as big as Apple's. Its free cash flow over the past 12 months of $31.4 billion also trails behind Apple. However, the huge software company has more cash on hand, with nearly $133 billion in cash, cash equivalents, and short-term investments.

Another area where Microsoft holds the advantage over its longtime foe is with its dividend. Microsoft's dividend yield currently stands at 2.16%. Over the past five years, the company has boosted its dividend by more than 80%. The prospects of more dividend increases down the road seem pretty good: Microsoft's payout ratio is around 56%.

Although Microsoft stock hasn't performed quite as well as Apple stock has so far in 2017, the software company's share price is still up an impressive 27%. And over the past five years, Microsoft's performance has trounced Apple's.

Microsoft continues to be a smart investing choice, in part because the company has successfully transformed itself into a software-as-a-service provider, which translates to dependable recurring revenue. Also, Microsoft has remained at the forefront of innovation in several key areas, including augmented reality and artificial intelligence.

Johnson & Johnson

Johnson & Johnson is the world's largest healthcare company, with a market cap of around $385 billion. The company generated free cash flow of $17.6 billion over the past 12 months. J&J's cash position of $13.5 billion might not look overly impressive, but the healthcare giant's recently completed $30 billion acquisition of Swiss drugmaker Actelion depleted its coffers somewhat. 

Johnson & Johnson has long been a favorite for income investors. J&J's dividend currently yields 2.37%. The company is a member of the elite group of Dividend Aristocrats and has increased its dividend for 55 consecutive years. More dividend boosts are likely, with J&J using less than 55% of earnings to fund the dividend program.

Despite lackluster results in its first two quarters of this year, J&J stock performed well. And concerns about the company's growth appear to have been thrown to the side, after Johnson & Johnson reported solid revenue and earnings growth in the third quarter.

I like J&J's prospects over the long run. The company's biggest unit, its pharmaceutical segment, has a strong roster of pipeline candidates. Johnson & Johnson also continues to make acquisitions to fuel growth, including the purchase of Abbott Medical Optics to help its once-flailing medical devices business. Look for J&J, along with Apple and Microsoft, to continue minting money and returning much of it to shareholders in the form of dividends.