My goal is to use several Checkbox
and activate them in such a way that the numbers are drawn and thus obtain the time from the class Calendar
or the class Date
. I would like to clarify the question more: I want them to CheckBox
be marked/activated, perhaps relating it to a mapping and from there being able to determine which ones are activated and which ones are not, but making it look like a clock from a distance, more or less like this:
I have found the solution.
First I get the hour, minutes and seconds using the class
GregorianCalendar
andDate
to assign the time to Calendar:Then I assign the values to the variables
Int hora, minuto y segundo;
with Calendar:So on. And then under each of the variables I make a switch that analyzes them with values from 0-1 (for the method
HOUR
that is different fromHOUR_OF_DAY
that it is from 0-24). The switch will have the corresponding cases and there then I activate the CheckBox so that it forms the "00" in case it is twelve o'clock.