private void jButton_printActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_printActionPerformed
        try {

            int numLinhaSelecionada = jT_lista.getSelectedRow();
            int id = Integer.parseInt(jT_lista.getValueAt(numLinhaSelecionada, 0).toString());
            PedidoDAO pD = new PedidoDAO();

            Connection con;
            Myconnection conexao = new Myconnection();
            con = conexao.getConnection();

            String local = System.getProperty("user.dir");

            InputStream stream = getClass().getResourceAsStream("/relatorio/comprovante.jrxml");

            //JasperDesign jasperDesign = JRXmlLoader.load(local+"/src/relatorio/comprovante.jrxml");
            JasperDesign jasperDesign = JRXmlLoader.load(stream);

            JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);

            Map parametro = new HashMap();
            Pedido pedido = pD.getPedidoById(id);
            parametro.put("telefone",pedido.getCliente().getTelefone());
            parametro.put("id",pedido.getId());
            parametro.put("nome", pedido.getCliente().getNome());
            parametro.put("endereco", pedido.getCliente().getEndereco());

            JasperPrint print;

            print = JasperFillManager.fillReport(jasperReport, parametro, con);
            //JasperExportManager.exportReportToPdfFile(print, "/relatorio/relatorio.pdf");
            JasperViewer viewer = new JasperViewer(print, false);
            viewer.setTitle("Comprovante");
            viewer.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            if (!print.getPages().isEmpty()) {
                viewer.setExtendedState(JasperViewer.MAXIMIZED_BOTH);
                viewer.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                //viewer.setSize(d);
                viewer.setVisible(true);
                viewer.setAlwaysOnTop(true);
            }
            
        } catch (Exception e) {
            JOptionPane.showMessageDialog(this, "Por favor, selecione o pedido.");
        }
    }//GEN-LAST:event_jButton_printActionPerformed