Tercera parte: (recuerda unir las tres partes.
Código java:
Ver originalprivate void ponerDia(int dia_entero, int x, int y) {
x=x-32;
y=y-30;
switch(dia_entero){
case 1:
add(dia1);
dia1.setBounds(x-10, y-30, 30, 25);
dia1.setVisible(true);
break;
case 2:
add(dia2);
dia2.setBounds(x-10, y-30, 30, 25);
dia2.setVisible(true);
break;
case 3:
add(dia3);
dia3.setBounds(x-10, y-30, 30, 25);
dia3.setVisible(true);
break;
case 4:
add(dia4);
dia4.setBounds(x-10, y-30, 30, 25);
dia4.setVisible(true);
break;
case 5:
add(dia5);
dia5.setBounds(x-10, y-30, 30, 25);
dia5.setVisible(true);
break;
case 6:
add(dia6);
dia6.setBounds(x-10, y-30, 30, 25);
dia6.setVisible(true);
break;
case 7:
add(dia7);
dia7.setBounds(x-10, y-30, 30, 25);
dia7.setVisible(true);
break;
case 8:
add(dia8);
dia8.setBounds(x-10, y-30, 30, 25);
dia8.setVisible(true);
break;
case 9:
add(dia9);
dia9.setBounds(x-10, y-30, 30, 25);
dia9.setVisible(true);
break;
case 10:
add(dia10);
dia10.setBounds(x-10, y-30, 30, 25);
dia10.setVisible(true);
break;
case 11:
add(dia11);
dia11.setBounds(x-10, y-30, 30, 25);
dia11.setVisible(true);
break;
case 12:
add(dia12);
dia12.setBounds(x-10, y-30, 30, 25);
dia12.setVisible(true);
case 13:
add(dia13);
dia13.setBounds(x-10, y-30, 30, 25);
dia13.setVisible(true);
break;
case 14:
add(dia14);
dia14.setBounds(x-10, y-30, 30, 25);
dia14.setVisible(true);
break;
case 15:
add(dia15);
dia15.setBounds(x-10, y-30, 30, 25);
dia15.setVisible(true);
break;
case 16:
add(dia16);
dia16.setBounds(x-10, y-30, 30, 25);
dia16.setVisible(true);
break;
case 17:
add(dia17);
dia17.setBounds(x-10, y-30, 30, 25);
dia17.setVisible(true);
break;
case 18:
add(dia18);
dia18.setBounds(x-10, y-30, 30, 25);
dia18.setVisible(true);
break;
case 19:
add(dia19);
dia19.setBounds(x-10, y-30, 30, 25);
dia19.setVisible(true);
break;
case 20:
add(dia20);
dia20.setBounds(x-10, y-30, 30, 25);
dia20.setVisible(true);
break;
case 21:
add(dia21);
dia21.setBounds(x-10, y-30, 30, 25);
dia21.setVisible(true);
break;
case 22:
add(dia22);
dia22.setBounds(x-10, y-30, 30, 25);
dia22.setVisible(true);
break;
case 23:
add(dia23);
dia23.setBounds(x-10, y-30, 30, 25);
dia23.setVisible(true);
break;
case 24:
add(dia24);
dia24.setBounds(x-10, y-30, 30, 25);
dia24.setVisible(true);
break;
case 25:
add(dia25);
dia25.setBounds(x-10, y-30, 30, 25);
dia25.setVisible(true);
break;
case 26:
add(dia26);
dia26.setBounds(x-10, y-30, 30, 25);
dia26.setVisible(true);
break;
case 27:
add(dia27);
dia27.setBounds(x-10, y-30, 30, 25);
dia27.setVisible(true);
break;
case 28:
add(dia28);
dia28.setBounds(x-10, y-30, 30, 25);
dia28.setVisible(true);
break;
case 29:
add(dia29);
dia29.setBounds(x-10, y-30, 30, 25);
dia29.setVisible(true);
break;
case 30:
add(dia30);
dia30.setBounds(x-10, y-30, 30, 25);
dia30.setVisible(true);
break;
case 31:
add(dia31);
dia31.setBounds(x-10, y-30, 30, 25);
dia31.setVisible(true);
break;
}
}
private void reiniciarBotones() {
dia1.setVisible(false);
dia2.setVisible(false);
dia3.setVisible(false);
dia4.setVisible(false);
dia5.setVisible(false);
dia6.setVisible(false);
dia7.setVisible(false);
dia8.setVisible(false);
dia9.setVisible(false);
dia10.setVisible(false);
dia11.setVisible(false);
dia12.setVisible(false);
dia13.setVisible(false);
dia14.setVisible(false);
dia15.setVisible(false);
dia16.setVisible(false);
dia17.setVisible(false);
dia18.setVisible(false);
dia19.setVisible(false);
dia20.setVisible(false);
dia21.setVisible(false);
dia22.setVisible(false);
dia23.setVisible(false);
dia24.setVisible(false);
dia25.setVisible(false);
dia26.setVisible(false);
dia27.setVisible(false);
dia28.setVisible(false);
dia29.setVisible(false);
dia30.setVisible(false);
dia31.setVisible(false);
}
}
public calendarioLayout() {
}
}
public void removeLayoutComponent
(Component comp
) { }
Insets insets
= parent.
getInsets(); dim.width = 405 + insets.left + insets.right;
dim.height = 205 + insets.top + insets.bottom;
return dim;
}
return dim;
}
public void layoutContainer
(Container parent
) { Insets insets
= parent.
getInsets();
c = parent.getComponent(0);
if (c.isVisible()) {c.setBounds(insets.left+10,insets.top+4,56,32);}
c = parent.getComponent(1);
if (c.isVisible()) {c.setBounds(insets.left+74,insets.top+4,56,32);}
c = parent.getComponent(2);
if (c.isVisible()) {c.setBounds(insets.left+138,insets.top+4,128,32);}
c = parent.getComponent(3);
if (c.isVisible()) {c.setBounds(insets.left+274,insets.top+4,56,32);}
c = parent.getComponent(4);
if (c.isVisible()) {c.setBounds(insets.left+338,insets.top+4,56,32);}
c = parent.getComponent(5);
if (c.isVisible()) {c.setBounds(insets.left+66,insets.top+44,48,24);}
c = parent.getComponent(6);
if (c.isVisible()) {c.setBounds(insets.left+122,insets.top+44,48,24);}
c = parent.getComponent(7);
if (c.isVisible()) {c.setBounds(insets.left+178,insets.top+44,48,24);}
c = parent.getComponent(8);
if (c.isVisible()) {c.setBounds(insets.left+234,insets.top+44,48,24);}
c = parent.getComponent(9);
if (c.isVisible()) {c.setBounds(insets.left+290,insets.top+44,48,24);}
c = parent.getComponent(10);
if (c.isVisible()) {c.setBounds(insets.left+10,insets.top+44,48,24);}
c = parent.getComponent(11);
if (c.isVisible()) {c.setBounds(insets.left+346,insets.top+44,48,24);}
}
}