Any way you look at it, 2017 was a great year for the Dow Jones Industrial Average (DJINDICES:^DJI). The Dow rose nearly 26% this year, its best performance since 2013. Of the 30 stocks in the index, only five didn't post gains during 2017.

But 2017 was even better than great for three Dow stocks. Boeing (NYSE:BA), Caterpillar (NYSE:CAT), and Apple (NASDAQ:AAPL) enjoyed stellar performances this year. Here's how these winners racked up huge gains -- and whether they're still smart picks after their tremendous runs in 2017.

2017 with chart going up

Image source: Getty Images.

Boeing

Boeing is by far the most successful Dow stock of the year, with its share price skyrocketing 90%. In 2016, the aircraft manufacturer saw its stock climb less than 8%. What happened to put the air beneath Boeing's wings? 

The company started off 2017 with a first-quarter revenue decline. In April, it even announced that it was laying off hundreds of employees. You might wonder how the stock performed so well in the midst of such seemingly bad news. The answer is that there's more to the story.

First of all, Boeing's earnings and cash flow improved significantly in 2017. The sluggish revenue reported in the first quarter gave way to stronger revenue by the third quarter. Along the way, Boeing snagged multiple multibillion-dollar defense contracts. 

The aerospace giant also saw lots of interest in its new 737 MAX 10 -- the biggest 737 jet yet. Boeing's 787 Dreamliner widebody airplanes were a solid hit as well for the company in 2017. 

Investors didn't just enjoy Boeing's tremendous stock gains. The company continued to pay out an attractive quarterly dividend throughout 2017, boosting Boeing's total return for the year above 95% with reinvested dividends. And while it won't make a difference for this year, in December Boeing increased its dividend for 2018 by more than 20%. 

Excavators lined up

Image source: Getty Images.

Caterpillar

Caterpillar ranks as the No. 2 Dow stock of 2017, with its stock vaulting 70% higher. It's the second year in a row for the construction and mining equipment maker to post market-beating gains. In 2016, Caterpillar's share price rose 36%.

You'd expect a stock that turns in this kind of performance would also generate strong earnings growth. And that's exactly what Caterpillar has done. In the third quarter of 2017, for example, the company's earnings per share more than triple what it reported in the prior-year period.

There are several reasons behind Caterpillar's impressive numbers. One of the biggest is increased infrastructure spending in China. It certainly didn't hurt Caterpillar that China enjoyed stronger-than-expected GDP growth in 2017. However, there were also some positives closer to home. Caterpillar benefited from higher spending in the oil and gas industry in North America, driven by higher oil prices. In addition, the U.S. housing market continued to grow, while the picture for non-residential construction improved.

Perhaps the most important reason why Caterpillar crushed it in 2017 was identified by my colleague Lee Samaha recently. He noted that Caterpillar is a cyclical company with good operating leverage. The combination of those two factors means that when revenue increases (as it inevitably does for cyclical companies), the solid operative leverage results in even stronger earnings growth. That's definitely been the case for Caterpillar this year.

Like Boeing, Caterpillar gave investors more than just stock appreciation. The company increased its dividend a little earlier in 2017. Reinvesting those dividends would have bumped Caterpillar's total return this year up to more than 75%.

Apple

Apple slugged it out with Visa for the distinction of being the third-best Dow stock of 2017. The technology giant's share price soared nearly 47% this year. That's much better than the 10% gain posted by Apple in 2016.

The current reality is that as the iPhone goes, so goes Apple. 2017 was a great year for iPhone sales. Apple's launch of the iPhone 7 and 7 Plus in September 2016 was successful, with momentum carrying over into this year. And despite earlier fears that its iPhone 8 and iPhone X launches wouldn't be as strong, Apple reported a record fiscal fourth quarter in November. Even better, it announced an overwhelmingly positive outlook for its fiscal 2018 first quarter, which ends in December 2017.

While the iPhone remains the most important product by far for Apple, other areas are booming as well. The services segment, which includes the App Store, iTunes, AppleCare, Apple Pay, licensing, and more, was one of Apple's fastest-growing sources of revenue this year. And the company's Mac computers turned in the best year ever in fiscal 2017. At the same time, sales for Apple Watch grew rapidly. The company could even break out Apple Watch, along with AirPods, into a new wearables product segment down the road.

It's possible that Apple could have generated even greater stock returns in 2017 were it not for a scandal emerging at the end of the year. It confirmed in December that it slowed down processors in older iPhone models, and said this was done to prevent problems with the phones' batteries. However, some suspect its motive instead was to boost sales of its newer iPhones. 

Investors don't have much to complain about, though. With dividends reinvested, Apple delivered a total return this year of over 49%.  

2018 with 8 pushing 7 down

Image source: Getty Images.

Smart picks for 2018?

Are these big Dow winners of 2017 smart picks for the new year also? Don't count on the big gains seen this year for two of the three.

Boeing should continue to see success with its newer aircraft, despite losing a big contract recently. However, the stock's valuation is on the high end now. While Caterpillar could benefit from improving conditions in the mining industry, it's also heavily dependent on China. It wouldn't be surprising if China's growth in 2018 could slow somewhat.

On the other hand, I think that Apple's momentum should continue into 2018. The new iPhone 8 and iPhone X have proven to be hits. Apple Watch and Mac sales are climbing. I expect another solid year for Apple and think it just might be a top-performing Dow stock yet again in 2018.

Keith Speights owns shares of Apple. The Motley Fool owns shares of and recommends Apple and Visa. The Motley Fool has the following options: long January 2020 $150 calls on Apple and short January 2020 $155 calls on Apple. The Motley Fool has a disclosure policy.