It's wasn't just the sun heating up the Hawaii set of Cougar Town Wednesday. While filming, Courteney Cox took a dip in a teeny-weeny two-piece

"Being 40-something is fantastic," she told last year. "All the confidence I wish I had when I was 30, now I have it."

She credits plenty of gym time for her fab physique. "Some people might not want to show the parts of them that aren't the best but I work out really hard," says Cox, who has trained with celeb fitness guru Tracy Anderson. "I try really hard." See more pics of Courteney on set in Hawaii.

It's paying off. Also taking notice? Costar and rumored beau Brian Van Holt. During the Hawaii shoot, the pair had separate rooms but "Brian went in and out of her suite four times a day," a source tells the new issue of Us Weekly (on stands now).

(A Cox pal insists the two are just friends.)

For more details on how Cox got cozy with her costar in Hawaii, check out the new Us Weekly, out today.