private void jBSaveMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jBSaveMouseClicked
        if (p.getLogged() == null) {
            JOptionPane.showMessageDialog(this, "Please sign in to edit a music",
                    "INFO", JOptionPane.INFORMATION_MESSAGE);
            this.dispose();//close window
            return;
        }

        //novos campos preenchidos pelo utilizador 
        String title = jTName.getText().trim();
        String artist = jTArtist.getText().trim();
        String album = jTAlbum.getText().trim();
        String year = jTYear.getText().trim();
        this.m = p.getApp().searchMusic(p.getPnTabelaMusica().getCliqueMusica());
        
        if (p.getApp().validateName(title)
                && p.getApp().validateName(album)
                && p.getApp().validateInt(year)
                && p.getApp().validateDate(year)) {
            p.getApp().editMusic(m, title, artist, album,
            Integer.parseInt(year));
            JOptionPane.showMessageDialog(null, "Musica alterada");
        } else {
            if (!p.getApp().validateName(title)) {
                jTName.setBorder(BorderFactory.createLineBorder(Color.RED));
                jLERROname.setVisible(true);
            }
            if (!p.getApp().validateName(album)) {
                jTAlbum.setBorder(BorderFactory.createLineBorder(Color.RED));
                jLERROAlbum.setVisible(true);
            }

            if (!p.getApp().validateInt(year) && p.getApp().validateDate(year)) {
                jTYear.setBorder(BorderFactory.createLineBorder(Color.RED));
                jLERROYear.setVisible(true);
            }
        }
        p.getApp().listMusics();
        this.dispose();//close window

    }//GEN-LAST:event_jBSaveMouseClicked