Mejoras de estilo y otros
This commit is contained in:
		
							parent
							
								
									0ade46bde2
								
							
						
					
					
						commit
						667182d76e
					
				
							
								
								
									
										1
									
								
								bin/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								bin/.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1,2 +1,3 @@ | ||||
| /VistaControlador/ | ||||
| /Logica/ | ||||
| /IniciarSesion/ | ||||
|  | ||||
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										27
									
								
								src/IniciarSesion/Usuario.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								src/IniciarSesion/Usuario.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | ||||
| package IniciarSesion; | ||||
| 
 | ||||
| import java.io.Serializable; | ||||
| 
 | ||||
| public class Usuario implements Serializable{ | ||||
| 	String nombre; | ||||
| 	String contrasenia; | ||||
| 	boolean admin; | ||||
| 	 | ||||
| 	public Usuario(String nombre, String contrasenia, boolean admin) { | ||||
| 		this.admin = admin; | ||||
| 		this.nombre = nombre; | ||||
| 		this.contrasenia = contrasenia; | ||||
| 	} | ||||
| 	 | ||||
| 	public boolean comprobar(String contrasenia) { | ||||
| 		if(this.contrasenia.equals(contrasenia)) { | ||||
| 			return true; | ||||
| 		} | ||||
| 		return false; | ||||
| 	} | ||||
| 	 | ||||
| 	public String getUsuario() { | ||||
| 		return this.nombre; | ||||
| 	} | ||||
| 	 | ||||
| } | ||||
							
								
								
									
										8
									
								
								src/IniciarSesion/Validacion.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/IniciarSesion/Validacion.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,8 @@ | ||||
| package IniciarSesion; | ||||
| 
 | ||||
| import java.io.File; | ||||
| 
 | ||||
| public class Validacion { | ||||
| 	File fichero; | ||||
| 	 | ||||
| } | ||||
| @ -13,15 +13,15 @@ public class Gestion{ | ||||
| 	 | ||||
| 	public Gestion() { | ||||
| 		this.gestiones=new Vector<Transaccion>(); | ||||
| 		this.suma=0; | ||||
| 		Gestion.total=0; | ||||
| 		this.suma = 0; | ||||
| 		Gestion.total = 0; | ||||
| 	} | ||||
| 	 | ||||
| 	public Gestion(String nombre) { | ||||
| 		this.gestiones=new Vector<Transaccion>(); | ||||
| 		this.suma=0; | ||||
| 		Gestion.total=0; | ||||
| 		this.nombre=nombre; | ||||
| 		this.gestiones = new Vector<Transaccion>(); | ||||
| 		this.suma = 0; | ||||
| 		Gestion.total = 0; | ||||
| 		this.nombre = nombre; | ||||
| 	} | ||||
| 	 | ||||
| 	public String getNombre() { | ||||
| @ -30,11 +30,11 @@ public class Gestion{ | ||||
| 	 | ||||
| 	public void aniadirGasto(Transaccion transaccion) { | ||||
| 		this.gestiones.add(transaccion); | ||||
| 		this.suma+=transaccion.getDinero(); | ||||
| 		this.suma += transaccion.getDinero(); | ||||
| 		if(transaccion.isPositivo()) { | ||||
| 			Gestion.total+=transaccion.getDinero(); | ||||
| 			Gestion.total += transaccion.getDinero(); | ||||
| 		}else { | ||||
| 			Gestion.total-=transaccion.getDinero(); | ||||
| 			Gestion.total -= transaccion.getDinero(); | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| @ -52,18 +52,18 @@ public class Gestion{ | ||||
| 	 | ||||
| 	public void alterarVisibilidad(int elemento) { | ||||
| 		if(this.gestiones.get(elemento).alterarVisivilidad()) { | ||||
| 			this.suma+=this.gestiones.get(elemento).getDinero(); | ||||
| 			this.suma += this.gestiones.get(elemento).getDinero(); | ||||
| 			if(this.gestiones.get(elemento).isPositivo()) { | ||||
| 				Gestion.total+=this.gestiones.get(elemento).getDinero(); | ||||
| 				Gestion.total += this.gestiones.get(elemento).getDinero(); | ||||
| 			}else { | ||||
| 				Gestion.total-=this.gestiones.get(elemento).getDinero(); | ||||
| 				Gestion.total -= this.gestiones.get(elemento).getDinero(); | ||||
| 			} | ||||
| 		}else { | ||||
| 			this.suma-=this.gestiones.get(elemento).getDinero(); | ||||
| 			this.suma -= this.gestiones.get(elemento).getDinero(); | ||||
| 			if(this.gestiones.get(elemento).isPositivo()) { | ||||
| 				Gestion.total-=this.gestiones.get(elemento).getDinero(); | ||||
| 				Gestion.total -= this.gestiones.get(elemento).getDinero(); | ||||
| 			}else { | ||||
| 				Gestion.total+=this.gestiones.get(elemento).getDinero(); | ||||
| 				Gestion.total += this.gestiones.get(elemento).getDinero(); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| @ -8,13 +8,13 @@ private ArrayList<Mes> meses; | ||||
| 	private int mesActual=0; | ||||
| 	 | ||||
| 	public Meses() { | ||||
| 		this.meses=new ArrayList<Mes>(); | ||||
| 		this.meses = new ArrayList<Mes>(); | ||||
| 	} | ||||
| 	 | ||||
| 	public void aniadirTransaccion(Transaccion transaccion, String nombre) { | ||||
| 		for(Mes mes:this.meses) { | ||||
| 			if(transaccion.getDia().getMonth().equals(mes.getMes()) && | ||||
| 					transaccion.getDia().getYear()==mes.getAnio()){ | ||||
| 					transaccion.getDia().getYear() == mes.getAnio()){ | ||||
| 				mes.aniadirTransaccion(transaccion, nombre); | ||||
| 				return; | ||||
| 			} | ||||
| @ -24,9 +24,9 @@ private ArrayList<Mes> meses; | ||||
| 	} | ||||
| 	 | ||||
| 	public void elegirMes(int anio, Month mes) { | ||||
| 		for(int i=0;i<this.meses.size();i++) { | ||||
| 		for(int i = 0; i < this.meses.size(); i++) { | ||||
| 			if(this.meses.get(i).getAnio()==anio && this.meses.get(i).getMes().equals(mes)) { | ||||
| 				this.mesActual=0; | ||||
| 				this.mesActual = 0; | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| @ -35,9 +35,6 @@ private ArrayList<Mes> meses; | ||||
| 		return this.meses.get(this.mesActual).getGestiones(); | ||||
| 	} | ||||
| 	 | ||||
| 	 | ||||
| 	 | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| class Mes{ | ||||
| @ -46,7 +43,7 @@ class Mes{ | ||||
| 	int total; | ||||
| 	ArrayList<Gestion> gestiones; | ||||
| 	Mes(ArrayList<Gestion> gestiones){ | ||||
| 		this.gestiones=gestiones; | ||||
| 		this.gestiones = gestiones; | ||||
| 	} | ||||
| 	 | ||||
| 	void aniadirTransaccion(Transaccion transaccion, String nombre) { | ||||
|  | ||||
| @ -10,23 +10,23 @@ public class Transaccion { | ||||
| 	private boolean positivo; | ||||
| 	 | ||||
| 	public Transaccion(String nombre, float dinero){ | ||||
| 		this.nombre=nombre; | ||||
| 		this.dinero=dinero; | ||||
| 		this.visible=true; | ||||
| 		this.dia=LocalDate.now(); | ||||
| 		this.positivo=true; | ||||
| 		this.nombre = nombre; | ||||
| 		this.dinero = dinero; | ||||
| 		this.visible = true; | ||||
| 		this.dia = LocalDate.now(); | ||||
| 		this.positivo = true; | ||||
| 	} | ||||
| 	 | ||||
| 	public Transaccion(String nombre, float dinero, LocalDate dia, boolean positivo){ | ||||
| 		this.nombre=nombre; | ||||
| 		this.dinero=dinero; | ||||
| 		this.visible=true; | ||||
| 		this.positivo=positivo; | ||||
| 		this.dia=dia; | ||||
| 		this.nombre = nombre; | ||||
| 		this.dinero = dinero; | ||||
| 		this.visible = true; | ||||
| 		this.positivo = positivo; | ||||
| 		this.dia = dia; | ||||
| 	} | ||||
| 	 | ||||
| 	public String toString() { | ||||
| 		return this.nombre+" "+this.dinero; | ||||
| 		return this.nombre + " " + this.dinero; | ||||
| 	} | ||||
| 	 | ||||
| 	public boolean getVisivilidad() { | ||||
| @ -34,16 +34,11 @@ public class Transaccion { | ||||
| 	} | ||||
| 	 | ||||
| 	public boolean alterarVisivilidad() { | ||||
| 		this.visible=!this.visible; | ||||
| 		this.visible =! this.visible; | ||||
| 		return this.visible; | ||||
| 	} | ||||
| 	 | ||||
| 	public float getDinero() { | ||||
| 		/*if(positivo) { | ||||
| 			return this.dinero; | ||||
| 		}else { | ||||
| 			return -this.dinero; | ||||
| 		}*/ | ||||
| 		return this.dinero; | ||||
| 	} | ||||
| 	 | ||||
|  | ||||
| @ -12,7 +12,7 @@ class CheckBoxList<E> extends JCheckBox implements ListCellRenderer<E> { | ||||
| 	private static final long serialVersionUID = 3734536442230283966L; | ||||
| 
 | ||||
| 	@Override | ||||
| 	public Component getListCellRendererComponent(JList<? extends E> list,E value, int index, boolean isSelected, boolean cellHasFocus) { | ||||
| 	public Component getListCellRendererComponent(JList<? extends E> list, E value, int index, boolean isSelected, boolean cellHasFocus) { | ||||
| 		setComponentOrientation(list.getComponentOrientation()); | ||||
| 
 | ||||
| 		setFont(list.getFont()); | ||||
|  | ||||
| @ -13,20 +13,20 @@ public class ControladorAniadirVisualizar implements ActionListener,ChangeListen | ||||
| 
 | ||||
| 	private VistaAniadirVisualizar vista; | ||||
| 	public ControladorAniadirVisualizar(VistaAniadirVisualizar vista) { | ||||
| 		this.vista=vista; | ||||
| 		this.vista = vista; | ||||
| 		this.aniadirListeners(); | ||||
| 	} | ||||
| 
 | ||||
| 	public void actionPerformed(ActionEvent e) { | ||||
| 		if(e.getActionCommand().equals(this.vista.boton.getActionCommand())) { | ||||
| 			String nombre=JOptionPane.showInputDialog("Introduce un nuevo gasto o ingreso"); | ||||
| 			if(nombre==null) return; | ||||
| 			if(nombre == null) return; | ||||
| 			if(nombre.equals("")) { | ||||
| 				JOptionPane.showMessageDialog(null, "Debe introducir algo", "error", JOptionPane.WARNING_MESSAGE); | ||||
| 				return; | ||||
| 			} | ||||
| 			String dinero=JOptionPane.showInputDialog("Introduce a cuanto asciende"); | ||||
| 			if(dinero==null) return; | ||||
| 			String dinero = JOptionPane.showInputDialog("Introduce a cuanto asciende"); | ||||
| 			if(dinero == null) return; | ||||
| 			if(dinero.equals("")) { | ||||
| 				JOptionPane.showMessageDialog(null, "Debe introducir algo", "error", JOptionPane.WARNING_MESSAGE); | ||||
| 				return; | ||||
| @ -41,8 +41,8 @@ public class ControladorAniadirVisualizar implements ActionListener,ChangeListen | ||||
| 				JOptionPane.showMessageDialog(null, "Debe introducir un numero", "error", JOptionPane.WARNING_MESSAGE); | ||||
| 			} | ||||
| 		}else { | ||||
| 			JCheckBox pulsado=(JCheckBox)e.getSource(); | ||||
| 			for(int i=0;i<vista.gestiones.getElementos().size();i++) { | ||||
| 			JCheckBox pulsado = (JCheckBox)e.getSource(); | ||||
| 			for(int i = 0; i < vista.gestiones.getElementos().size();i++) { | ||||
| 				if(vista.gestiones.getElementos().get(i).toString().equals(pulsado.getText())) { | ||||
| 					vista.gestiones.alterarVisibilidad(i); | ||||
| 					this.vista.menu.panel.actualizarDatos(this.vista.gestiones); | ||||
| @ -56,7 +56,7 @@ public class ControladorAniadirVisualizar implements ActionListener,ChangeListen | ||||
| 	private void aniadirListeners() { | ||||
| 		vista.boton.addActionListener(this); | ||||
| 		vista.boton.setActionCommand("Aniadir"); | ||||
| 		int contador=0; | ||||
| 		int contador = 0; | ||||
| 		for(JCheckBox check:this.vista.transacciones) { | ||||
| 			check.addActionListener(this); | ||||
| 			check.setActionCommand("pulsar "+contador); | ||||
|  | ||||
| @ -26,33 +26,30 @@ public class ControladorPanelLateral implements ActionListener, DateChangeListen | ||||
| 	 | ||||
| 	 | ||||
| 	public ControladorPanelLateral(VistaPanelLateral vista) { | ||||
| 		this.vista=vista; | ||||
| 		this.vista = vista; | ||||
| 		this.aniadirElementos(); | ||||
| 	} | ||||
| 	 | ||||
| 	public void actionPerformed(ActionEvent e) { | ||||
| 		if(e.getActionCommand().equals(this.vista.mostrarEstadisticas.getActionCommand())) { | ||||
| 			 | ||||
| 			XYSeries serie=new XYSeries("Mes"); | ||||
| 			XYSeries serie = new XYSeries("Mes"); | ||||
| 			serie.add(10,1); | ||||
| 			serie.add(4,2); | ||||
| 			serie.add(90,10); | ||||
| 			XYSeriesCollection dataset=new XYSeriesCollection(serie); | ||||
| 			JFreeChart chart=ChartFactory.createXYLineChart("Mes", "Dias", "Gastos", dataset); | ||||
| 			ChartFrame frame=new ChartFrame("Estadisricas", chart); | ||||
| 			XYSeriesCollection dataset = new XYSeriesCollection(serie); | ||||
| 			JFreeChart chart = ChartFactory.createXYLineChart("Mes", "Dias", "Gastos", dataset); | ||||
| 			ChartFrame frame = new ChartFrame("Estadisricas", chart); | ||||
| 			frame.setVisible(true); | ||||
| 			frame.setSize(700,500); | ||||
| 		} | ||||
| 		//}else if(e.getActionCommand().equals(this.vista.elegirMes.getActionCommand())){ | ||||
| 			 | ||||
| 		//} | ||||
| 		 | ||||
| 	} | ||||
| 	 | ||||
| 	private void aniadirElementos() { | ||||
| 		this.vista.mostrarEstadisticas.addActionListener(this); | ||||
| 		this.vista.mostrarEstadisticas.setActionCommand("Mostrar estadisticas"); | ||||
| 		if(VistaPanelLateral.elegirMes.getDateChangeListeners().size()==0) { | ||||
| 		if(VistaPanelLateral.elegirMes.getDateChangeListeners().size() == 0) { | ||||
| 			VistaPanelLateral.elegirMes.addDateChangeListener(this); | ||||
| 			this.mes=VistaPanelLateral.elegirMes.getDate().getMonth(); | ||||
| 			this.anio=VistaPanelLateral.elegirMes.getDate().getYear(); | ||||
|  | ||||
| @ -24,19 +24,19 @@ public class Menu extends JFrame{ | ||||
| 	protected Gestion datosIngresos; | ||||
| 	public Menu() { | ||||
| 		VistaAniadirVisualizar.setPanelLateral(panel); | ||||
| 		this.datosGastos=new Gestion(); | ||||
| 		this.datosIngresos=new Gestion(); | ||||
| 		this.datosGastos = new Gestion(); | ||||
| 		this.datosIngresos = new Gestion(); | ||||
| 		this.setLayout(new GridBagLayout()); | ||||
| 		GridBagConstraints constrain=new GridBagConstraints(); | ||||
| 		this.panel=new VistaPanelLateral(constrain); | ||||
| 		this.ingresos=new VistaAniadirVisualizar(this,datosIngresos,true); | ||||
| 		this.gastos=new VistaAniadirVisualizar(this,datosGastos,false); | ||||
| 		this.panelCentral=new JPanel(); | ||||
| 		this.pestania=new JTabbedPane(); | ||||
| 		constrain.fill=GridBagConstraints.VERTICAL; | ||||
| 		constrain.gridx=0; | ||||
| 		constrain.gridy=0; | ||||
| 		constrain.weightx=2; | ||||
| 		GridBagConstraints constrain = new GridBagConstraints(); | ||||
| 		this.panel = new VistaPanelLateral(constrain); | ||||
| 		this.ingresos = new VistaAniadirVisualizar(this,datosIngresos,true); | ||||
| 		this.gastos = new VistaAniadirVisualizar(this,datosGastos,false); | ||||
| 		this.panelCentral = new JPanel(); | ||||
| 		this.pestania = new JTabbedPane(); | ||||
| 		constrain.fill = GridBagConstraints.VERTICAL; | ||||
| 		constrain.gridx = 0; | ||||
| 		constrain.gridy = 0; | ||||
| 		constrain.weightx = 2; | ||||
| 		this.panelCentral.add(pestania,constrain); | ||||
| 		this.pestania.addTab("Ingresos", ingresos); | ||||
| 		this.pestania.addTab("Gastos", gastos); | ||||
| @ -45,17 +45,12 @@ public class Menu extends JFrame{ | ||||
| 		setSize(new Dimension(420,320)); | ||||
| 		setDefaultCloseOperation(3); | ||||
| 		setLocationRelativeTo(null); | ||||
| 		ControladorAniadirVisualizar controlador=new ControladorAniadirVisualizar(this.ingresos); | ||||
| 		ControladorAniadirVisualizar controlador2=new ControladorAniadirVisualizar(this.gastos); | ||||
| 		ControladorPanelLateral controlador3=new ControladorPanelLateral(this.panel); | ||||
| 		/*constrain.fill=GridBagConstraints.HORIZONTAL; | ||||
| 		constrain.gridx=1; | ||||
| 		constrain.gridy=0; | ||||
| 		constrain.weightx=1; | ||||
| 		constrain.weighty=2;*/ | ||||
| 		ControladorAniadirVisualizar controlador = new ControladorAniadirVisualizar(this.ingresos); | ||||
| 		ControladorAniadirVisualizar controlador2 = new ControladorAniadirVisualizar(this.gastos); | ||||
| 		ControladorPanelLateral controlador3 = new ControladorPanelLateral(this.panel); | ||||
| 		this.panel.actualizarDatos(datosIngresos); | ||||
| 		this.pestania.addChangeListener((ChangeListener)->{ | ||||
| 			if(this.pestania.getSelectedIndex()==0) { | ||||
| 			if(this.pestania.getSelectedIndex() == 0) { | ||||
| 				this.panel.actualizarDatos(datosIngresos); | ||||
| 			}else { | ||||
| 				this.panel.actualizarDatos(datosGastos); | ||||
| @ -64,6 +59,4 @@ public class Menu extends JFrame{ | ||||
| 		this.add(this.panel); | ||||
| 	} | ||||
| 	 | ||||
| 	 | ||||
| 	 | ||||
| } | ||||
|  | ||||
| @ -23,16 +23,15 @@ public class VistaAniadirVisualizar extends JPanel{ | ||||
| 	boolean positivo; | ||||
| 	static VistaPanelLateral panelLateral; | ||||
| 	public VistaAniadirVisualizar(Menu menu, Gestion gestion,boolean positivo) { | ||||
| 		this.positivo=positivo; | ||||
| 		this.gestiones=gestion; | ||||
| 		this.transacciones=new LinkedList<JCheckBox>(); | ||||
| 		this.menu=menu; | ||||
| 		this.x=100; | ||||
| 		this.boton=new JButton("aniadir"); | ||||
| 		//this.gestiones=new Gestion(); | ||||
| 		this.positivo = positivo; | ||||
| 		this.gestiones = gestion; | ||||
| 		this.transacciones = new LinkedList<JCheckBox>(); | ||||
| 		this.menu = menu; | ||||
| 		this.x = 100; | ||||
| 		this.boton = new JButton("aniadir"); | ||||
| 		this.add(boton); | ||||
| 		this.cuadro=new JPanel(); | ||||
| 		this.panel=new JScrollPane(cuadro); | ||||
| 		this.cuadro = new JPanel(); | ||||
| 		this.panel = new JScrollPane(cuadro); | ||||
| 		this.panel.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); | ||||
| 		this.panel.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); | ||||
| 		cuadro.setPreferredSize(new Dimension(x, y)); | ||||
| @ -42,19 +41,19 @@ public class VistaAniadirVisualizar extends JPanel{ | ||||
| 	} | ||||
| 	 | ||||
| 	public static void setPanelLateral(VistaPanelLateral panel) { | ||||
| 		VistaAniadirVisualizar.panelLateral=panel; | ||||
| 		VistaAniadirVisualizar.panelLateral = panel; | ||||
| 	} | ||||
| 	 | ||||
| 	public void aniadirElemento(String nombre, float dinero, ControladorAniadirVisualizar controlador) { | ||||
| 		Transaccion transaccion=new Transaccion(nombre, dinero,panelLateral.getDate(),this.positivo); | ||||
| 		Transaccion transaccion = new Transaccion(nombre, dinero,panelLateral.getDate(),this.positivo); | ||||
| 		this.gestiones.aniadirGasto(transaccion); | ||||
| 		JCheckBox check=new JCheckBox(transaccion.toString()); | ||||
| 		JCheckBox check = new JCheckBox(transaccion.toString()); | ||||
| 		check.setSelected(true); | ||||
| 		check.setSize(new Dimension(x,VistaAniadirVisualizar.altoCheck)); | ||||
| 		check.addActionListener(controlador); | ||||
| 		this.transacciones.add(check); | ||||
| 		this.cuadro.add(check); | ||||
| 		this.y+=VistaAniadirVisualizar.altoCheck; | ||||
| 		this.y += VistaAniadirVisualizar.altoCheck; | ||||
| 		cuadro.setPreferredSize(new Dimension(x, y)); | ||||
| 		this.revalidate(); | ||||
| 		this.repaint(); | ||||
|  | ||||
| @ -17,32 +17,32 @@ public class VistaPanelLateral extends JPanel{ | ||||
| 	protected JTextArea total; | ||||
| 	protected JTextArea gastoEnvio; | ||||
| 	//protected JButton elegirMes; | ||||
| 	protected static DatePicker elegirMes=inicializarCalendario(); | ||||
| 	protected static DatePicker elegirMes = inicializarCalendario(); | ||||
| 	protected JButton mostrarEstadisticas; | ||||
| 	 | ||||
| 	VistaPanelLateral(GridBagConstraints constrain){ | ||||
| 		this.setPreferredSize(new Dimension(200,200)); | ||||
| 		this.total=new JTextArea(); | ||||
| 		this.gastoEnvio=new JTextArea(); | ||||
| 		this.mostrarEstadisticas=new JButton("Mostrar grafico del mes"); | ||||
| 		this.total = new JTextArea(); | ||||
| 		this.gastoEnvio = new JTextArea(); | ||||
| 		this.mostrarEstadisticas = new JButton("Mostrar grafico del mes"); | ||||
| 		this.add(this.mostrarEstadisticas); | ||||
| 		constrain.gridx=1; | ||||
| 		constrain.gridy=0; | ||||
| 		constrain.weightx=2; | ||||
| 		constrain.gridx = 1; | ||||
| 		constrain.gridy = 0; | ||||
| 		constrain.weightx = 2; | ||||
| 		this.add(VistaPanelLateral.elegirMes); | ||||
| 		constrain.gridx=1; | ||||
| 		constrain.gridy=1; | ||||
| 		constrain.weightx=2; | ||||
| 		constrain.gridx = 1; | ||||
| 		constrain.gridy = 1; | ||||
| 		constrain.weightx = 2; | ||||
| 		this.add(this.total); | ||||
| 		constrain.gridx=1; | ||||
| 		constrain.gridy=2; | ||||
| 		constrain.weightx=2; | ||||
| 		constrain.gridx = 1; | ||||
| 		constrain.gridy = 2; | ||||
| 		constrain.weightx = 2; | ||||
| 		this.add(this.gastoEnvio); | ||||
| 	} | ||||
| 	 | ||||
| 	void actualizarDatos(Gestion gestion) { | ||||
| 		this.total.setText("Total: "+String.valueOf(Gestion.getTotal())+"€"); | ||||
| 		this.gastoEnvio.setText("Suma: "+String.valueOf(gestion.getSuma())+"€"); | ||||
| 		this.total.setText("Total: " + String.valueOf(Gestion.getTotal()) + "€"); | ||||
| 		this.gastoEnvio.setText("Suma: " + String.valueOf(gestion.getSuma()) + "€"); | ||||
| 	} | ||||
| 	 | ||||
| 	static LocalDate getDate() { | ||||
| @ -50,7 +50,7 @@ public class VistaPanelLateral extends JPanel{ | ||||
| 	} | ||||
| 	 | ||||
| 	static DatePicker inicializarCalendario() { | ||||
| 		DatePicker ret=new DatePicker(); | ||||
| 		DatePicker ret = new DatePicker(); | ||||
| 		ret.setDate(LocalDate.now()); | ||||
| 		return ret; | ||||
| 	} | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user