Use JTextPane in Java with HTML to print reports

We are all familiar with the Java Swing class JTextArea. Java also has a method called print associated with the JComponent class that can be used to print a JTextArea contents onto a printer. JTextArea jt = new JTextArea();┬ájt.setText("whatever text you desire"); jt.print(); The above code segment will print the contents of the JTextArea jt … Continue reading Use JTextPane in Java with HTML to print reports