Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-04-2008, 08:48 AM
Member
 
Join Date: Feb 2008
Posts: 2
coldblood22 is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-05-2008, 03:43 PM
Member
 
Join Date: Apr 2008
Posts: 1
jsyoung72 is on a distinguished road
What does dia.paint(g2d); do?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT +3. The time now is 04:03 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org