How Do I Print Clear Text?

Hi, I'm new to this forum and new to Java in general, so please bear with me.
I am writing a desktop application that returns textual data in a complex table format. The user needs to be able to edit the data once it is returned, so I display the data in JTextAreas arranged on a JPanel with a gridBagLayout. This displays just fine on screen, but the user needs to be able to print out a hardcopy of the results.
I am able to print out the JPanel, but the method I am using leaves the text looking grainy and bit-mappy-- like an enlarged screen capture. It needs to look as clean and crisp as if it came out of a word processor.
My 'MainClass' instantiates a 'PrinterJob' called 'printJob'. The class that creates the JPanel implements 'Printable', calls the 'setPrintable()' method of 'printJob', and contains the following 'print()' method...
public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {
if (pageIndex > 0){
return NO_SUCH_PAGE;
} else {
Graphics2D g2D = (Graphics2D) g;
g2D.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
MainClass.displayPanel.paintComponents(g2D);
return PAGE_EXISTS;
When I actually print out the page though, the layout of all of the elements is correct but the text looks horrible. I've been scouring the web for days, and I bought two new reference books looking for a solution, but so far I've come up empty.
Can somone out there help me?

When you call a component's paintComponent(Graphics g) method, it automaticly will paint the background and all of the object's graphics/text. When you overload the paintComponent method you normally call the super.PaintComponent(Graphic g) method... which will cause the component to paint it's background. If you wish to avoid painting the background, and thus probably making your text easier to read, you will need another method that draws the same graphic but doesn't call super.paintComponent()
I would suggest haveing something like this:
public void paintComponent(Graphics g) {
  super.PaintComponent();
  paintGraphics(g);
private void paintGraphics(Graphics g) {
  //paint your graphics here
public void printComponent(Graphics g) {
  paintGraphics(g);
}When you want to print the component call the printComponent method, and when you wish to paint the component you can call the paintComponent method.
I don't really know if this is what you are after,
webaf409java

Similar Messages

  • How can I print a text message conversation from my iPhone? Not using screenshots.

    How can I print a text message conversation from my iPhone? Not using screenshots. It's around 500 messages so screenshots is not a option.

    Yes, you can delete from iphone:
    http://manuals.info.apple.com/enUS/iPhone_iOS4_UserGuide.pdf
    It is covered in the manual.
    Page 172:
    "Delete a podcast: In the Podcasts list in iPod, swipe left or right over the podcast, then
    tap Delete. "

  • How do you print a text message chain

    How do you print a text message chain?

    There is an App called SMS Export in the App Store which allows exporting SMS and iMessages from an iPhone to a Mac or PC where you can print them. There is no way to print a message chain directly from the iPhone.
    See: https://itunes.apple.com/us/app/sms-export/id316914912?mt=8

  • How can I print my text message

    End of the year and would like to file my text messages. How can I print, please help? Thanks

    I review the available sms backup applications in the Play Store to see if one meets your needs.

  • How can i print a text message

    how can i print text meaasge's

    you can copy paste it to notes
    or you can take a screenshot and print it that way

  • How do I print my text message thread?

    Does anyone know how to print my text message thread to my computer??

    Search for SMS Backup in the Play Store. There several that will probably meet your needs.

  • HOW CAN I PRINT MY TEXT MESSAGES

    Is there a way to print my text messages?

    Hi,
    This app in the app store will do that:
    http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=316914912&mt=8
    There is no built in functionality to do this, so you'll need this app or another similar one.

  • How can I print a text message?  I need a printout for legal reasons

    I received a text message which needs to be printed as part of an ongoing litigation.  I can't figure out how to send it to an email address so I can print it out.  can you help?

    Do a screen shot of the text and email it to yourself and then print.
    Or spend some money on this http://www.wideanglesoftware.com/touchcopy/index.php  to extract text to your computer.

  • How can i print out text messages from my iPhone 5

    How to print text messages from iPhone 5

    SMS text messages are backed up with the iPhone - whether it's locally or to iCloud. If you've already written over the backup that had them (as in, backed up after the delete) then they're gone.
    If you still have a backup available from a time where you had the messages on your iPhone, all you have to do is erase the iPhone and restore from that backup.
    "Retrieve deleted messages from iPhone" is simple as pie.

  • How can I print a text with my comments in Pages 5.0?

    I have made comments on a text in Pages 5.0.  How can I now print the file and have my comments included in the hardcopy?

    I have found a round-about solution to my own problem:  with the file open, click file, export the file back into an earlier version of Pages, save the new file and then print it, but there has to be a better solution from within the new version of Pages.

  • How can I print/ upload Text messages onto my computer to print?

    Ive been harassed by my ex-boyfriend and i need to print out the text messages hes been sending me for court, can someone explain to me how i can do this?

        I understand the need for printing out important messages lea17. Do you have the messages saved? If they are still stored on your handset, I recommend forwarding them to an e-mail address. This is the best option for printing.
    JonathanK_VZW
    VZWSupport
    Follow Us on Twitter@VZWSupport

  • How can I print out text messages?

    I have very long strings of texts that I need to print out.  I know that I can take a screen shot and print it like a photo, but I want to print it in a more direct way.

    Try the computer apps PhoneView (Mac) or TouchCopy (Mac & PC):
    http://www.ecamm.com/mac/phoneview/
    http://www.wideanglesoftware.com/touchcopy/index.php

  • How can I print long text in Notification

    Dear All,
    I want to take Long Text of notification in my printout . Please tell me where this is stored and how can I access it as I am unable to find out it in notification table.
    Regards

    In the long text screen
    Go to header
    Here all the details of the text are available.

  • HT3529 how do I print my text messages?

    can someone help me learn to print out my text messages?

    Go to the first message that you want to start printing. Hold your finger on the message until you get the bubble that says copy, more, speak above it. Press "more" and a check mark will appear next to the first message and empty circles will be next to all other messages. Click the circles and check marks will appear next to the messages that you want to send. When you are done choosing your messages, click the send arrow on the bottom of the screen. Put in your email address and press send. Your messages will be sent as an attachment that you can open and print. Hope this helps.

  • How do i print my text history?

    I need help, I am wanting to get my text history off my phone and print it.

    You would need to get a 3rd party application such as Touchcopy to get the text info off the phone to be able to print it. Or, if just a small conversation you can touch and hold one of the bubbles, then select more. Select each of the ones you want to print and then you can click share and email it to yourself to print.
    I'm sorry, email is not an option after more, just the ability to forward in another text.
    There is no native way to print an SMS/iMessage on the phone.
    Message was edited by: ChrisJ4203

Maybe you are looking for

  • How do I delete e-mail accounts in Mail 6.0 using Mountain Lion?

    I have installed Mountain Lion on my MBP. Since then I have developed a problem with Mail Version 6.0 (1485).  When I send mail from my regular account as picked at the bottom of the New Message box it is the one I use all the time.  I write the mess

  • A few ADF BC state passivation/activation problems

    Our development team has encountered and researched a few ADF BC passivation/activation related bugs that are very annoying. Some of them have been fixed in the new JDeveloper 11gR1 (11.1.1.1.0) but other ones are still active in the last production

  • Contribute CS4 for the PC

    Hi there. We have a client who is using Contribute CS4 on Windows, which they downloaded and installed sometime ago. They have since lost the original install file and are in need of reloading the software. They have a serial number. Are you able to

  • Use LOOP in workflow

    hi experts:     when I create one notice,many leaders will approve or reject the notice one by one.I want to use "loop until" in workflow template,how can it carry out?     thanks a lot!

  • Bluetooth on Samsung Series 3 12.5"?

    Samsung - Laptop / Intel® Core™ i5 Processor / 12.5" Display / 4GB Memory - Black Model: NP350U2A-W01UB | SKU: 3495261 3 days ago, I drove 1 hour to the Bestbuy in Ann Arbor, MI to buy this little laptop. According to Bestbuy website (and a geek squa