In June you can talk to the boy in the shrine and he'll mention that he's missing his bug catching net. Visit again at night and there's a creepy-looking lady in white who'll give you the net when you talk to her.
Come back later during the day and the boy will let you keep the net and you'll be able to catch bugs from the tree (this doesn't use up time). Wait to swing until the exclamation mark pops up above your head and you should get a perfect swing!