private void togglePlayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_togglePlayActionPerformed
//        dadosTabela = pnTabelaMusica.getArray();
//        if (!dadosTabela.isEmpty()) {
//            int tamanho = dadosTabela.size();
//            for (int i = tamanho - 1; i >= 0; i--) {
//                dadosTabela.remove(i);
//            }
//        }
        /*
        pnBaseTabela.removeAll();
        pnBaseTabela.add(pnTabelaMusica);
        revalidate();
        repaint();*/

        dadosTabela = pnTabelaMusica.getDadosArray();
        rowIndex = pnTabelaMusica.getTblMusic().getSelectedRow();

        //System.out.println("Indice da tabela " + rowIndex);

        f = getApp().stringToMp3(dadosTabela);

        for (int i = 0; i < dadosTabela.size(); i++) {
            player.addToPlayList(f[i]);

        }//adiciona as musicas da playlist da tabela ao MP3player

        if (togglePlay.isSelected()) {
            togglePlay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/Pause-32.png")));
            togglePlay.setBorder(null);
            togglePlay.setContentAreaFilled(true);
            
            String currentSong = (String) f[rowIndex].getAbsolutePath();
            
            player = new MP3Player(new File(currentSong));
            player.play();

        } else {
            togglePlay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/Play-32__green.png")));
            togglePlay.setBorder(null);
            togglePlay.setContentAreaFilled(false);
            player.pause();
            
            pnBaseTabela.removeAll();
            ArrayList <Music> aux = pnTabelaMusica.getDadosArray();
            setPnTabelaMusica(new PnTabelaMusica(this, aux));
            pnBaseTabela.add(pnTabelaMusica);
            revalidate();
            repaint();
            

        //dadosTabela = pnTabelaMusica.getDadosArray();
            //rowIndex = pnTabelaMusica.getTblMusic().getSelectedRow();
        }

    }//GEN-LAST:event_togglePlayActionPerformed