For some reason when I try to print something my program freezes. If I shutdown the program then it will begin printing. I've looked through many of the tutorials, my code is the same as what they display. The class below is instantiated in another class and then the JPanel "ListingPanel" is added to either another panel or a frame. When a print button is hit it calls the printMe() method. Also when the program freezes it will cause the number of pages to be printed to go up until the application is shut down. e.g. if you look at the print manager for the printer, it says printing 1/100, 1/1264, and so on, the number will keep going up until the application is forcefully ended. Finally the 2d graphics object is not used because i removed it in testing, it didn't matter which one i used it still would freeze.
public class ListingPanel extends JPanel implements Printable
public int print(Graphics g, PageFormat pf, int pi) throws PrinterException
//Graphics2D g2 = (Graphics2D) g;
Font f = new Font("Monospaced",Font.PLAIN,12);
public void printMe()
PrinterJob printJob = PrinterJob.getPrinterJob();
catch (Exception PrintException)