private void tabEstoqueStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_tabEstoqueStateChanged
        // TODO add your handling code here:
        int tabIndex = tabEstoque.getSelectedIndex();

        Conexao dbCon = new Conexao();

        //Método usado para atualizar as tabelas, quando o usuario muda de aba.
        switch (tabIndex) {
            case 0:
                try {
                    dbCon.getTabelaEstoque();
                } catch (SQLException | ClassNotFoundException ex) {
                    Logger.getLogger(Janela.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case 1:
                Date dataHoje = new Date(System.currentTimeMillis());
                SimpleDateFormat formatarDate = new SimpleDateFormat("dd/MM/yyyy");
                Janela.labelData.setText(formatarDate.format(dataHoje));
                break;
            case 2:
                try {
                    dbCon.getTabelaCadastro();
                } catch (SQLException | ClassNotFoundException ex) {
                    Logger.getLogger(Janela.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case 3:
                try {
                    dbCon.getTabelaHistorico();
                } catch (SQLException | ClassNotFoundException ex) {
                    Logger.getLogger(Janela.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
        }

    }//GEN-LAST:event_tabEstoqueStateChanged