Añadida funcionalidad checkbox

This commit is contained in:
2019-11-07 22:53:35 +01:00
parent a6afa6adb6
commit ebbbcfcb10
5 changed files with 96 additions and 31 deletions

View File

@@ -1,27 +1,39 @@
package VistaControlador;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import Logica.Gestion;
public class Menu extends JFrame{
protected JPanel panelCentral;
protected JTabbedPane pestania;
protected Vista ingresos;
protected Vista gastos;
protected JTextArea total;
public Menu() {
init();
}
private void init() {
this.setLayout(new GridBagLayout());
GridBagConstraints constrain=new GridBagConstraints();
this.ingresos=new Vista(this);
this.gastos=new Vista(this);
this.panelCentral=new JPanel();
this.pestania=new JTabbedPane();
this.panelCentral.add(pestania);
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);
getContentPane().add(pestania);
@@ -32,6 +44,13 @@ public class Menu extends JFrame{
setLocationRelativeTo(null);
Controlador controlador=new Controlador(this.ingresos);
Controlador controlador2=new Controlador(this.gastos);
constrain.fill=GridBagConstraints.HORIZONTAL;
constrain.gridx=1;
constrain.gridy=0;
constrain.weightx=1;
constrain.weighty=2;
this.total=new JTextArea(String.valueOf(Gestion.getTotal()));
this.add(this.total,constrain);
}
}