ErroresPorTraza.TabbedForm.java Source code

Java tutorial

Introduction

Here is the source code for ErroresPorTraza.TabbedForm.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ErroresPorTraza;

import helpers.WriteReport;
import charts.TiposErrorChart;
import charts.ErroresPorMilChart;
import charts.ErrorPorcentajePie;
import charts.AceptadosRechazadosPie;
import frame.PanelSeleccion;
import java.awt.FlowLayout;
import javax.swing.JTable;
import javax.swing.table.TableColumnModel;
import org.jfree.chart.ChartPanel;

/**
 *
 * @author aguilangeles@gmail.com
 */
public class TabbedForm extends javax.swing.JFrame {

    int suma;
    private final Procesar procesor;
    private String tablaresult;

    /**
     * Creates new form TabbedForm
     *
     * @param procesor
     */
    public TabbedForm(Procesar procesor) {
        initComponents();
        this.setResizable(false);
        this.suma = procesor.getSuma();
        this.procesor = procesor;
        jTable1.setModel(procesor.getErrorModel());
        setSizeColumn(jTable1);

        jTableErrores_2.setModel(procesor.getErrorModel());
        setSizeColumn(jTableErrores_2);

        jTable2.setModel(procesor.getCantidad());
        setSizeColumn(jTable2);

        jTable3.setModel(procesor.getPormil());
        setSizeColumnMil(jTable3);
        jTextArea1.setText(procesor.resultados());

        setChartCantidadErrores();
        setChartAceptadosRechazados();
        setChartCantidadErroresPorMil();

    }

    private void setSizeColumn(JTable jTable1) {
        TableColumnModel model1 = jTable1.getColumnModel();
        model1.getColumn(0).setPreferredWidth(300);
        model1.getColumn(1).setPreferredWidth(75);
    }

    private void setSizeColumnMil(JTable jTable1) {
        TableColumnModel model1 = jTable1.getColumnModel();
        model1.getColumn(0).setPreferredWidth(195);
        model1.getColumn(1).setPreferredWidth(60);
        model1.getColumn(2).setPreferredWidth(60);
        model1.getColumn(3).setPreferredWidth(60);
    }

    private void setChartCantidadErrores() {
        TiposErrorChart chartError = new TiposErrorChart();
        ChartPanel chartpanel1 = chartError.getChartPanel("Cantidad de errores", jTable1);
        jPanelChartError.removeAll();
        jPanelChartError.setLayout(new FlowLayout(FlowLayout.LEFT));
        jPanelChartError.add(chartpanel1);
        this.setLocationRelativeTo(null);
        int totales = chartError.getSumaCantidades();
        setChartPorcentaje(totales);
        tablaresult = chartError.getResultadosExcell();
    }

    private void setChartCantidadErroresPorMil() {
        ErroresPorMilChart chartErrores = new ErroresPorMilChart();
        ChartPanel chartpanel1 = chartErrores.getChartPanel("Errores por mil", jTable3);
        jPanelMill.removeAll();
        jPanelMill.setLayout(new FlowLayout(FlowLayout.LEFT));
        jPanelMill.add(chartpanel1);
        this.setLocationRelativeTo(null);
    }

    private void setChartAceptadosRechazados() {
        AceptadosRechazadosPie aceptrech = new AceptadosRechazadosPie();
        ChartPanel chartpanel1 = aceptrech.getChartPanel("Estado de Trazas", jTable2, suma);
        jPanelAceptRech.removeAll();
        jPanelAceptRech.setLayout(new FlowLayout(FlowLayout.LEFT));
        jPanelAceptRech.add(chartpanel1);
        this.setLocationRelativeTo(null);
    }

    private void setChartPorcentaje(int tt) {
        ErrorPorcentajePie aceptrech = new ErrorPorcentajePie();
        ChartPanel chartpanel1 = aceptrech.getChartPanel("Porcentaje de errores", jTable1, tt);
        jPanelPorcentaje.removeAll();
        jPanelPorcentaje.setLayout(new FlowLayout(FlowLayout.LEFT));
        jPanelPorcentaje.add(chartpanel1);
        this.setLocationRelativeTo(null);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel4 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jTabbedPaneErrores = new javax.swing.JTabbedPane();
        jPanelErrores = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jPanelChartError = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jPanelPorcentaje = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTableErrores_2 = new javax.swing.JTable();
        jPanelCantidad = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jPanelAceptRech = new javax.swing.JPanel();
        jPanelPorMil = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();
        jPanelMill = new javax.swing.JPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));

        jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED,
                new java.awt.Color(153, 153, 255), new java.awt.Color(153, 153, 255),
                new java.awt.Color(153, 153, 255), new java.awt.Color(153, 153, 255)));
        jPanel1.setOpaque(false);

        jTextArea1.setColumns(20);
        jTextArea1.setFont(new java.awt.Font("Arimo", 0, 14)); // NOI18N
        jTextArea1.setRows(5);
        jTextArea1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jScrollPane4.setViewportView(jTextArea1);

        jButton1.setFont(new java.awt.Font("Arimo", 0, 18)); // NOI18N
        jButton1.setText("Volver");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Arimo", 0, 18)); // NOI18N
        jButton2.setText("Guardar Resultados");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setFont(new java.awt.Font("Arimo", 0, 18)); // NOI18N
        jButton3.setText("Cerrar");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Arimo", 0, 24)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(51, 51, 255));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Generales");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(jPanel1Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jButton2, javax.swing.GroupLayout.Alignment.LEADING,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.LEADING,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, 286, Short.MAX_VALUE)
                                        .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addContainerGap()))));
        jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 47,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane4).addGap(18, 18, 18)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 58,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(24, 24, 24).addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 57,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap()));

        jTabbedPaneErrores
                .setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED,
                        new java.awt.Color(153, 153, 255), new java.awt.Color(153, 153, 255),
                        new java.awt.Color(153, 153, 255), new java.awt.Color(153, 153, 255)));
        jTabbedPaneErrores.setFont(new java.awt.Font("Arimo", 2, 14)); // NOI18N

        jPanelErrores.setOpaque(false);

        jTable1.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        jTable1.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { { null, null } },
                new String[] { "Title 1", "Title 2" }) {
            Class[] types = new Class[] { java.lang.String.class, java.lang.Integer.class };

            public Class getColumnClass(int columnIndex) {
                return types[columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTable1);

        javax.swing.GroupLayout jPanelChartErrorLayout = new javax.swing.GroupLayout(jPanelChartError);
        jPanelChartError.setLayout(jPanelChartErrorLayout);
        jPanelChartErrorLayout.setHorizontalGroup(jPanelChartErrorLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 452, Short.MAX_VALUE));
        jPanelChartErrorLayout.setVerticalGroup(jPanelChartErrorLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));

        javax.swing.GroupLayout jPanelErroresLayout = new javax.swing.GroupLayout(jPanelErrores);
        jPanelErrores.setLayout(jPanelErroresLayout);
        jPanelErroresLayout.setHorizontalGroup(jPanelErroresLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelErroresLayout.createSequentialGroup().addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 381,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jPanelChartError, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
        jPanelErroresLayout.setVerticalGroup(jPanelErroresLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelErroresLayout.createSequentialGroup().addContainerGap()
                        .addGroup(jPanelErroresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 455,
                                        Short.MAX_VALUE)
                                .addComponent(jPanelChartError, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap()));

        jTabbedPaneErrores.addTab("Cantidad de Errores", jPanelErrores);

        jPanel2.setOpaque(false);

        jPanel3.setOpaque(false);

        javax.swing.GroupLayout jPanelPorcentajeLayout = new javax.swing.GroupLayout(jPanelPorcentaje);
        jPanelPorcentaje.setLayout(jPanelPorcentajeLayout);
        jPanelPorcentajeLayout.setHorizontalGroup(jPanelPorcentajeLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 438, Short.MAX_VALUE));
        jPanelPorcentajeLayout.setVerticalGroup(jPanelPorcentajeLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));

        jTableErrores_2.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        jTableErrores_2.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { { null, null } },
                new String[] { "Title 1", "Title 2" }) {
            Class[] types = new Class[] { java.lang.String.class, java.lang.Integer.class };

            public Class getColumnClass(int columnIndex) {
                return types[columnIndex];
            }
        });
        jScrollPane5.setViewportView(jTableErrores_2);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(jPanel3Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 381,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)
                        .addComponent(jPanelPorcentaje, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(19, 19, 19)));
        jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jPanelPorcentaje, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 455,
                                        Short.MAX_VALUE))
                        .addContainerGap()));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout
                .setHorizontalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                jPanel2Layout.createSequentialGroup()
                                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addContainerGap()));
        jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));

        jTabbedPaneErrores.addTab("Porcentajes en Errores", jPanel2);

        jPanelCantidad.setOpaque(false);

        jTable2.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        jTable2.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { { null, null } },
                new String[] { "Title 1", "Title 2" }) {
            Class[] types = new Class[] { java.lang.String.class, java.lang.Integer.class };

            public Class getColumnClass(int columnIndex) {
                return types[columnIndex];
            }
        });
        jScrollPane2.setViewportView(jTable2);

        javax.swing.GroupLayout jPanelAceptRechLayout = new javax.swing.GroupLayout(jPanelAceptRech);
        jPanelAceptRech.setLayout(jPanelAceptRechLayout);
        jPanelAceptRechLayout.setHorizontalGroup(jPanelAceptRechLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 446, Short.MAX_VALUE));
        jPanelAceptRechLayout.setVerticalGroup(jPanelAceptRechLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));

        javax.swing.GroupLayout jPanelCantidadLayout = new javax.swing.GroupLayout(jPanelCantidad);
        jPanelCantidad.setLayout(jPanelCantidadLayout);
        jPanelCantidadLayout.setHorizontalGroup(jPanelCantidadLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelCantidadLayout.createSequentialGroup().addContainerGap()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 387,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jPanelAceptRech, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
        jPanelCantidadLayout.setVerticalGroup(
                jPanelCantidadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanelCantidadLayout.createSequentialGroup().addContainerGap()
                                .addGroup(jPanelCantidadLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 455,
                                                Short.MAX_VALUE)
                                        .addComponent(jPanelAceptRech, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addContainerGap()));

        jTabbedPaneErrores.addTab("Acepdados y Rechazados", jPanelCantidad);

        jPanelPorMil.setOpaque(false);

        jTable3.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        jTable3.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { { null, null, null, null } },
                new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }) {
            Class[] types = new Class[] { java.lang.String.class, java.lang.Object.class, java.lang.Integer.class,
                    java.lang.Integer.class };

            public Class getColumnClass(int columnIndex) {
                return types[columnIndex];
            }
        });
        jScrollPane3.setViewportView(jTable3);

        javax.swing.GroupLayout jPanelMillLayout = new javax.swing.GroupLayout(jPanelMill);
        jPanelMill.setLayout(jPanelMillLayout);
        jPanelMillLayout.setHorizontalGroup(jPanelMillLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 446, Short.MAX_VALUE));
        jPanelMillLayout.setVerticalGroup(jPanelMillLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));

        javax.swing.GroupLayout jPanelPorMilLayout = new javax.swing.GroupLayout(jPanelPorMil);
        jPanelPorMil.setLayout(jPanelPorMilLayout);
        jPanelPorMilLayout.setHorizontalGroup(jPanelPorMilLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelPorMilLayout.createSequentialGroup().addContainerGap()
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 386,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jPanelMill, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(15, Short.MAX_VALUE)));
        jPanelPorMilLayout.setVerticalGroup(jPanelPorMilLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelPorMilLayout.createSequentialGroup().addContainerGap()
                        .addGroup(jPanelPorMilLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 455,
                                        Short.MAX_VALUE)
                                .addComponent(jPanelMill, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap()));

        jTabbedPaneErrores.addTab("Errores por 1000", jPanelPorMil);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(jPanel4Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTabbedPaneErrores, javax.swing.GroupLayout.PREFERRED_SIZE, 884,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
        jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jTabbedPaneErrores))
                        .addContainerGap()));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
                jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        String valor = procesor.resultados() + tablaresult;
        WriteReport write = new WriteReport();
        WriteReport.createNewSheet("Estadisticas", jButton1);
        WriteReport.writeReport(valor);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        System.exit(0);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new PanelSeleccion().setVisible(true);
            }
        });
        dispose();

    }//GEN-LAST:event_jButton1ActionPerformed

    /**
     * @param args the command line arguments
     */
    //    public static void main(String args[]) {
    //        /* Set the Nimbus look and feel */
    //        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
    //        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
    //         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
    //         */
    //        try {
    //            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
    //                if ("Nimbus".equals(info.getName())) {
    //                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
    //                    break;
    //                }
    //            }
    //        } catch (ClassNotFoundException ex) {
    //            java.util.logging.Logger.getLogger(TabbedForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    //        } catch (InstantiationException ex) {
    //            java.util.logging.Logger.getLogger(TabbedForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    //        } catch (IllegalAccessException ex) {
    //            java.util.logging.Logger.getLogger(TabbedForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    //        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
    //            java.util.logging.Logger.getLogger(TabbedForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    //        }
    //        //</editor-fold>
    //
    //        /* Create and display the form */
    //        java.awt.EventQueue.invokeLater(new Runnable() {
    //            public void run() {
    //                new TabbedForm().setVisible(true);
    //            }
    //        });
    //    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanelAceptRech;
    private javax.swing.JPanel jPanelCantidad;
    private javax.swing.JPanel jPanelChartError;
    private javax.swing.JPanel jPanelErrores;
    private javax.swing.JPanel jPanelMill;
    private javax.swing.JPanel jPanelPorMil;
    private javax.swing.JPanel jPanelPorcentaje;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JTabbedPane jTabbedPaneErrores;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable3;
    private javax.swing.JTable jTableErrores_2;
    private javax.swing.JTextArea jTextArea1;
    // End of variables declaration//GEN-END:variables
}