Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5970677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:24:33+00:00 2026-05-22T20:24:33+00:00

In my Application, I have a JTable with data and I need to add

  • 0

In my Application, I have a JTable with data and I need to add a print button which adds the functionality of printing the data in a table on printer paper (send a printer job), how is that possible using the PrinterJob' class?
I’ve been searching around for examples, but I couldn’t find a simple example that prints some data from a JComponent.

This is one of the Websites I found: http://java.sun.com/products/java-media/2D/forDevelopers/sdk12print.html.
But I am not sure what to focus on to understand how printing works (page format …etc).

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:24:34+00:00Added an answer on May 22, 2026 at 8:24 pm

    hmmm,

    todays Java6 Oracle tutotial about printing http://download.oracle.com/javase/tutorial/2d/printing/index.html contains http://download.oracle.com/javase/7/docs/api/javax/swing/JTable.html#print%28%29 which is described in JTable Tutorial including Runnable Examples, then you have to search (on this forum too) for correct Print paginations and orientations

    for example

    PrintRequestAttributeSet set = new HashPrintRequestAttributeSet();
    set.add(OrientationRequested.LANDSCAPE);
    resultFxTable.print(JTable.PrintMode.FIT_WIDTH, header, footer, false, set, false);
    

    note: I’m not sure that is possible correctly set Font, FontSize and FOntColor for PrintHeader and PrintFooter for JTable Printing

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a standalone application in which I have a Jtable. In my table,
In my application I have a DataGridView control that displays data for the selected
In my application I have a window which I popup with small messages on
In my iPhone application I have a table view. When user taps any row,
I have an application where I have a JTable with line breaks(pressing Enter key
I have a JTable in a swing application. I wrote a quick and dirty
I have a WinForms application. That application have a rich functionality. It can create
I have Silverlight application that retrieves data from the database through a WCF Service.
I have an game application I have written for Windows Mobile and I want
We have a Hibernate/Spring application that have the following Spring beans: <bean id=transactionManager class=org.springframework.orm.hibernate3.HibernateTransactionManager

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.