private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked

    
    JTextPane jtp = new JTextPane();
jtp.setBackground(Color.white);
jtp.setText(text);
boolean show = true;
try {
    jtp.print(null, null, show, null, null, show);
} catch (java.awt.print.PrinterException ex) {
    ex.printStackTrace();
}

}//GEN-LAST:event_jButton1MouseClicked