Image down = Toolkit.getDefaultToolkit().getImage(
pm.getIconLocation("pdown"));
widget = new Panel(new GridLayout(2,1,1,1));
Panel time = new BorderPanel(BorderPanel.IN);
time.setLayout(new GridLayout(1,3));
Panel date = new BorderPanel(BorderPanel.IN);
date.setLayout(new GridLayout(1,3));
// add the "hour" panel
h = new Label();
h.setAlignment(Label.CENTER);
dae = new DateActionListener(Calendar.HOUR_OF_DAY);
pl = new ImageButton(up);
pl.addActionListener(dae);
pl.setActionCommand("+");
mi = new ImageButton(down);
mi.addActionListener(dae);
mi.setActionCommand("-");
arrows = new Panel(new GridLayout(2,1));
arrows.add(pl);
arrows.add(mi);
p = new Panel(new BorderLayout());
p.add(h, "Center");
p.add(arrows, "East");
time.add(p);
// add the "min" panel
min = new Label();
min.setAlignment(Label.CENTER);
dae = new DateActionListener(Calendar.MINUTE);
pl = new ImageButton(up);
pl.addActionListener(dae);
pl.setActionCommand("+");
mi = new ImageButton(down);
mi.addActionListener(dae);
mi.setActionCommand("-");
arrows = new Panel(new GridLayout(2,1));
arrows.add(pl);
arrows.add(mi);
p = new Panel(new BorderLayout());
p.add(min, "Center");
p.add(arrows, "East");
time.add(p);
s = new Label();
s.setAlignment(Label.CENTER);
dae = new DateActionListener(Calendar.SECOND);
pl = new ImageButton(up);
pl.addActionListener(dae);
pl.setActionCommand("+");
mi = new ImageButton(down);
mi.addActionListener(dae);
mi.setActionCommand("-");
arrows = new Panel(new GridLayout(2,1));
arrows.add(pl);
arrows.add(mi);
p = new Panel(new BorderLayout());
p.add(s, "Center");
p.add(arrows, "East");
time.add(p);
// add the "day" panel
d = new Label();
d.setAlignment(Label.CENTER);
dae = new DateActionListener(Calendar.DAY_OF_MONTH);
pl = new ImageButton(up);
pl.addActionListener(dae);
pl.setActionCommand("+");
mi = new ImageButton(down);
mi.addActionListener(dae);
mi.setActionCommand("-");
arrows = new Panel(new GridLayout(2,1));
arrows.add(pl);
arrows.add(mi);
p = new Panel(new BorderLayout());
p.add(d, "Center");
p.add(arrows, "East");
date.add(p);
// then the "Month" panel
m = new Label();
m.setAlignment(Label.CENTER);
dae = new DateActionListener(Calendar.MONTH);
pl = new ImageButton(up);
pl.addActionListener(dae);
pl.setActionCommand("+");
mi = new ImageButton(down);
mi.addActionListener(dae);
mi.setActionCommand("-");
arrows = new Panel(new GridLayout(2,1));
arrows.add(pl);
arrows.add(mi);
p = new Panel(new BorderLayout());
p.add(m, "Center");
p.add(arrows, "East");
date.add(p);
// then the "Year" panel
y = new Label();
y.setAlignment(Label.CENTER);
dae = new DateActionListener(Calendar.YEAR);
pl = new ImageButton(up);
pl.addActionListener(dae);
pl.setActionCommand("+");
mi = new ImageButton(down);
mi.addActionListener(dae);
mi.setActionCommand("-");
arrows = new Panel(new GridLayout(2,1));
arrows.add(pl);
arrows.add(mi);
p = new Panel(new BorderLayout());
p.add(y, "Center");
p.add(arrows, "East");
date.add(p);
widget.add(time);
widget.add(date);
c = Calendar.getInstance();