That would be a rather basic Java question which is beyond the bounds of this forum for the development of mods.
Basic java questions should be googled or rather one should study basic java before one starts developing mods.
I would recommend googling around or looking into the java standard libraries and see what you can find
PS: For java questions try StackExchange or DreamInCode both are excellent places to get help
Disregard my last post I figured it out but with one problem, the number does not automatically countdown, like you have to refresh the menu in order for the number to change. Anyone know how to fix this?