Results 1 to 2 of 2
  1. #1
    coldblood22 is offline Member
    Join Date
    Feb 2008
    Posts
    3
    Rep Power
    0

    Default Problem after Printing GUI.

    Well in my Application i am using the java Printable interface to print the GUI.
    The printing is done fine but once done with the printing my program breaks off with the database file without. Well i haven't made any calls to close the database after printing. But after printing, none of the modules recognize the database file. I manually tried to close and open the database after printing but still it is not able to access the tables.
    I am using SQLite, and the exception i am getting is ' no such table found '.

    I tried to access the database file with another program with my application running and it was running fine.


    public void print() {
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);

    if (printJob.printDialog())
    try {
    printJob.print();
    } catch(PrinterException pe) {
    System.out.println("Error printing: " + pe);
    }
    }

    public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {
    // TODO Auto-generated method stub
    if (pageIndex > 0) {
    return(NO_SUCH_PAGE);
    }
    else {
    Graphics2D g2d = (Graphics2D)g;
    g2d.translate(73, 73);
    g2d.scale(0.65,0.8);

    disableDoubleBuffering(dia);
    dia.paint(g2d);
    enableDoubleBuffering(dia);
    return(PAGE_EXISTS);
    }

    }


    This is the code i am using to print the GUI.

    Any help will be appreciated.

  2. #2
    jsyoung72 is offline Member
    Join Date
    Apr 2008
    Posts
    1
    Rep Power
    0

Similar Threads

  1. Printing (no dialog)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-04-2008, 10:36 AM
  2. Problem in printing java graphics
    By Mahendra in forum Java 2D
    Replies: 0
    Last Post: 01-23-2008, 01:45 PM
  3. Printing using java
    By ramachandran in forum Advanced Java
    Replies: 1
    Last Post: 01-05-2008, 11:16 AM
  4. printing problem
    By ntpl in forum AWT / Swing
    Replies: 0
    Last Post: 11-27-2007, 12:20 PM
  5. [Java Printing]
    By remnahush in forum Advanced Java
    Replies: 1
    Last Post: 11-08-2007, 04:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •