Mejoras de estilo y otros

This commit is contained in:
roche
2019-11-14 12:05:58 +01:00
parent 0ade46bde2
commit 667182d76e
13 changed files with 126 additions and 109 deletions

View File

@@ -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);
}
}