Next off, I'm not sure exactly what it is that you're asking -- to check if the number is odd? that it's divisible by three? both?
Next, after clarifying your question, what have you tried so far, and how doesn't it work to your satisfaction?
And finally, I'm going to ask that the mods move this thread to the beginning Java section as it's not a Swing question.
Check out the % operator. For any multiple X of Y (for any values of X and Y), X % Y returns 0. I'm sure you can use that to check if a) your value is a divisible by 3, and b) your value is odd - not divisible by two.