Aniadido soporte para cambiar de mes
This commit is contained in:
@@ -20,6 +20,7 @@ public class VistaAniadirVisualizar extends JPanel{
|
||||
JPanel cuadro;
|
||||
JScrollPane panel;
|
||||
Menu menu;
|
||||
private ControladorAniadirVisualizar controlador;
|
||||
static VistaPanelLateral panelLateral;
|
||||
public VistaAniadirVisualizar(Menu menu, Gestion gestion) {
|
||||
this.gestiones = gestion;
|
||||
@@ -46,6 +47,12 @@ public class VistaAniadirVisualizar extends JPanel{
|
||||
return this.gestiones.getNombre();
|
||||
}
|
||||
|
||||
void iniciarGestion() {
|
||||
for(Transaccion transaccion:this.gestiones.getElementos()) {
|
||||
this.aniadirElemento(transaccion);
|
||||
}
|
||||
}
|
||||
|
||||
public void aniadirElemento(String nombre, float dinero, ControladorAniadirVisualizar controlador) {
|
||||
Transaccion transaccion = new Transaccion(nombre, dinero,panelLateral.getDate());
|
||||
this.gestiones.aniadirGasto(transaccion);
|
||||
@@ -60,4 +67,18 @@ public class VistaAniadirVisualizar extends JPanel{
|
||||
this.revalidate();
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
|
||||
private void aniadirElemento(Transaccion transaccion) {
|
||||
JCheckBox check = new JCheckBox(transaccion.toString());
|
||||
check.setSelected(true);
|
||||
check.setSize(new Dimension(x,VistaAniadirVisualizar.altoCheck));
|
||||
check.addActionListener(this.boton.getActionListeners()[0]);
|
||||
this.transacciones.add(check);
|
||||
this.cuadro.add(check);
|
||||
this.y += VistaAniadirVisualizar.altoCheck;
|
||||
cuadro.setPreferredSize(new Dimension(x, y));
|
||||
this.revalidate();
|
||||
this.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user