com.spirit.contabilidad.gui.panel.JPReporteNotas.java Source code

Java tutorial

Introduction

Here is the source code for com.spirit.contabilidad.gui.panel.JPReporteNotas.java

Source

package com.spirit.contabilidad.gui.panel;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.FormSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.layout.Sizes;
import com.jidesoft.combobox.DateComboBox;
import com.spirit.client.model.ReportModelImpl;

public abstract class JPReporteNotas extends ReportModelImpl {
    public JPReporteNotas() {
        initComponents();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        // Generated using JFormDesigner Open Source Project license - unknown
        lblEjercicioContable = new JLabel();
        cmbEjercicioContable = new JComboBox();
        lblFechaInicio = new JLabel();
        cmbFechaInicio = new DateComboBox();
        lblFechaFin = new JLabel();
        cmbFechaFin = new DateComboBox();
        btnConsultar = new JButton();
        spNotas = new JScrollPane();
        tblNotas = new JTable();
        CellConstraints cc = new CellConstraints();

        //======== this ========
        setLayout(new FormLayout(
                new ColumnSpec[] { new ColumnSpec(Sizes.dluX(12)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                        new ColumnSpec(Sizes.dluX(75)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                        new ColumnSpec(Sizes.dluX(100)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                        new ColumnSpec(Sizes.dluX(50)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                        new ColumnSpec(Sizes.dluX(100)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                        new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                        new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(12)) },
                new RowSpec[] { new RowSpec(Sizes.dluY(12)), FormFactory.LINE_GAP_ROWSPEC,
                        FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                        FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC,
                        FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                        new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                        FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                        new RowSpec(Sizes.dluY(12)) }));

        //---- lblEjercicioContable ----
        lblEjercicioContable.setText("Ejercicio Contable:");
        add(lblEjercicioContable, cc.xywh(3, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.FILL));
        add(cmbEjercicioContable, cc.xywh(5, 3, 5, 1, CellConstraints.FILL, CellConstraints.FILL));

        //---- lblFechaInicio ----
        lblFechaInicio.setText("Fecha Inicio:");
        add(lblFechaInicio, cc.xywh(3, 5, 1, 1, CellConstraints.RIGHT, CellConstraints.FILL));
        add(cmbFechaInicio, cc.xywh(5, 5, 1, 1, CellConstraints.FILL, CellConstraints.FILL));

        //---- lblFechaFin ----
        lblFechaFin.setText("Fecha Fin:");
        add(lblFechaFin, cc.xywh(7, 5, 1, 1, CellConstraints.RIGHT, CellConstraints.FILL));
        add(cmbFechaFin, cc.xywh(9, 5, 1, 1, CellConstraints.FILL, CellConstraints.FILL));

        //---- btnConsultar ----
        btnConsultar.setText("Consultar");
        add(btnConsultar, cc.xywh(13, 5, 1, 1, CellConstraints.LEFT, CellConstraints.FILL));

        //======== spNotas ========
        {

            //---- tblNotas ----
            tblNotas.setModel(new DefaultTableModel(new Object[][] {}, new String[] { "Resumen de Notas" }) {
                boolean[] columnEditable = new boolean[] { false };

                @Override
                public boolean isCellEditable(int rowIndex, int columnIndex) {
                    return columnEditable[columnIndex];
                }
            });
            spNotas.setViewportView(tblNotas);
        }
        add(spNotas, cc.xywh(3, 9, 12, 5));
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    // Generated using JFormDesigner Open Source Project license - unknown
    private JLabel lblEjercicioContable;
    private JComboBox cmbEjercicioContable;
    private JLabel lblFechaInicio;
    private DateComboBox cmbFechaInicio;
    private JLabel lblFechaFin;
    private DateComboBox cmbFechaFin;
    private JButton btnConsultar;
    private JScrollPane spNotas;
    private JTable tblNotas;
    // JFormDesigner - End of variables declaration  //GEN-END:variables

    public JComboBox getCmbEjercicioContable() {
        return cmbEjercicioContable;
    }

    public void setCmbEjercicioContable(JComboBox cmbEjercicioContable) {
        this.cmbEjercicioContable = cmbEjercicioContable;
    }

    public DateComboBox getCmbFechaInicio() {
        return cmbFechaInicio;
    }

    public void setCmbFechaInicio(DateComboBox cmbFechaInicio) {
        this.cmbFechaInicio = cmbFechaInicio;
    }

    public DateComboBox getCmbFechaFin() {
        return cmbFechaFin;
    }

    public void setCmbFechaFin(DateComboBox cmbFechaFin) {
        this.cmbFechaFin = cmbFechaFin;
    }

    public JButton getBtnConsultar() {
        return btnConsultar;
    }

    public void setBtnConsultar(JButton btnConsultar) {
        this.btnConsultar = btnConsultar;
    }

    public JTable getTblNotas() {
        return tblNotas;
    }

    public void setTblNotas(JTable tblNotas) {
        this.tblNotas = tblNotas;
    }
}