|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.palserv.clock.BinaryClock
public class BinaryClock
Make a binary clock. I have seen a physical version with LEDs and I loved it. So I made one in Java. It displays the time in six columns of four rows each. Each column represents a decimal digit, 0-9. Thus this display:
+---+---+---+---+---+---+ | | | | X | | | +---+---+---+---+---+---+ | | X | | | | X | +---+---+---+---+---+---+ | | | | | X | X | +---+---+---+---+---+---+ | | X | X | X | X | X | +---+---+---+---+---+---+represents 06:19:37, or 6:19 and 37 seconds.
Constructor Summary | |
---|---|
BinaryClock()
|
Method Summary | |
---|---|
void |
getArgs(java.lang.String[] args)
Get the command line arguments. |
static void |
main(java.lang.String[] args)
Run the clock from the command line. |
javax.swing.JPanel |
makeContentPane()
Create the clock in a JPanel. |
void |
makeFrame()
Create a frame so the GUI can run in a separate window. |
void |
runClock()
Run the clock. |
void |
setClock(int hour,
int minute,
int second)
Set the time to the given BTime object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinaryClock()
Method Detail |
---|
public static void main(java.lang.String[] args)
BinaryClock bc = new BinaryClock(); bc.makeFrame(); bc.runClock();This code could be used from another program.
args
- ignoredpublic void getArgs(java.lang.String[] args)
setColor
for an explanation of the format of the color spec
default is 206*206*206.
setColor
for an explanation of the format of the color spec
default is 0*0*206.
setColor
for an explanation of the format of the color spec
default is 128*255*255.
setColor
for an explanation of the format of the color spec
default is 0*0*0.
args
- the arguments as passed to mainpublic void runClock()
public void makeFrame()
public javax.swing.JPanel makeContentPane()
public void setClock(int hour, int minute, int second)
hour
- the current hourminute
- the current minutesecond
- the current second
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |