• Post Reply Bookmark Topic Watch Topic
  • New Topic

Trouble printing JTable

 
Stephanie Challand
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting the following message when trying to print a JTable.

"Java(TM) platform SE binary has stopped working"

Here is the code:

try {
MessageFormat headerFormat = new MessageFormat("Page {0}");
MessageFormat footerFormat = new MessageFormat("- {0} -");
table.print(JTable.PrintMode.FIT_WIDTH, headerFormat, footerFormat);
} catch (java.awt.print.PrinterException pe) {
System.err.println("Error printing: " + pe.getMessage());
}
 
Campbell Ritchie
Marshal
Posts: 52519
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that message what you get from that catch? Try adding the following to the catch:-
pe.printStackTrace();
 
Stephanie Challand
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No it is not getting into the catch. Another java window pops up with that message and I can close program or debug...

If I choose 'debug' I get the following:

Unhandled exception at 0x6fa67e6d in java.exe: 0xC000041D: An unhandled exception was encountered during a user callback.

 
Campbell Ritchie
Marshal
Posts: 52519
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No idea what that means. Sorry.
 
Stephanie Challand
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks...

So does anyone know how I can actually print the contents of a JTable then?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!