• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Printing Form

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I hav to print a frame having JTable with some data.
But its not working for me. I m using Java Print API.
pls help me out.....
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This may or may not help???
This is a print method used to print text from a large text edit area. I am not quite sure how it would handle printing a table. I sure that you could print all the contents of it, but I am not sure what it would look like.
Good luck!

/**
* This method prints a file from the text edit area.
*
* @return void
*/
void PrintCommand()
{
//Frame used for PrintJob toolkit
Frame frame = new Frame();
//Properties used for PrintJob toolkit
Properties p = new Properties();
PrintJob pjob = getToolkit().getPrintJob (frame, "Report", p);
if(pjob != null)
{
Graphics pg = pjob.getGraphics();
// Reset the paper's origin to allow for left 1 inch margin
// 72 pts equivalent to 1 inch
pg.translate(72,72);
if(pg != null)
{
String s = BROWSEWIN_mBrowseMTEd.getText();
printLongString (pjob, pg, s);
pg.dispose();
}
pjob.end();
}
}//end of PrintCommand()

------------------
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out the five part JavaWorld article, Printing in Java, at http://www.javaworld.com/javaworld/jw-10-2000/jw-1020-print_p.html
Maybe this can give you some insight to your problem.
John
 
Pay attention! Tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic