Fit screen to Print??/ Help please:)

Hi All,
I have a JPanel that I like to print with all its components... and following is the part of code I use for printing... however when it prints it prints in the center of the page with huge margins from the edge... big fonts and it doesn't print the width completely... the size of my screens are (780,565).... what am I missing in my code? would appreciate your help....
public void PrintData()
        PrinterJob printJob = PrinterJob.getPrinterJob();
        PageFormat format = new PageFormat();
        Paper paper = new Paper();
        paper.setImageableArea(0.0,0.0,780,485);
        format.setPaper(paper);
              if ( printJob.printDialog()) {
              for (int i=2; i<=7; i++) {
        cardLayout1.show(jPanel1, "jPanel" +i);
        printJob.setPrintable(this);                 
  public int print(Graphics g, PageFormat pf, int pi)
                 throws PrinterException {
     if (pi>0) return Printable.NO_SUCH_PAGE;
  double scale = 1.0;
  int panelwidth = this.getWidth();
  int panelHeight = this.getHeight();
  double imageableWidth = pf.getImageableWidth();
  double imageableHeight = pf.getImageableHeight();
  Font font = new Font("Verdana", 0, 10);
  FontMetrics f = g.getFontMetrics(font);
  int descent = f.getDescent();
  if(panelwidth > imageableWidth)
    scale = imageableWidth/panelwidth;
     Graphics2D g2 = (Graphics2D)g;
     g2.translate(pf.getImageableX(), pf.getImageableY());
     currentManager.setDoubleBufferingEnabled(false);
     paint(g2);
     currentManager.setDoubleBufferingEnabled(true);
     return Printable.PAGE_EXISTS;
    }

DLFDNFDNS wrote:
I have a MacBook Pro running OS X 10.4.11... The only changes would have been the automatic updates that run.
Are those Mac OS updates, Microsoft updates or what?
When I try to print from Entourage, I get an error that says "an error occured while printing. Not enought memory." When printing from Word I get an error that says "Word cannot print due to a problem with the current printer.
Can you print with a NON-microsoft application?
Consider booting the MB Pro from the Tiger Install disc holding the "c" key down. Select language, then from the Utilities menu, select Disk Utility. In Disk Utility, in the left pane, click on your hard drive and in the right pane, click on the First Aid tab. Near the bottom, click Repair Disk. If it finds any errors, it will try to repair them and then re-run the test again. After it re-tests without errors, click the Repair Permissions button. Reboot computer and launch Disk Utility in the Utilities folder and run Repair Permission from there.
Try printing.
HTH

Similar Messages

  • My iphone 4s just shut off and when i charge it the apple appears but it goes back to black screen...help please?

    my iphone 4s just shut off and when i charge it the apple appears but it goes back to black screen...help please?

    Hi Haleynichole_99!
    I have an article here with some troubleshooting steps that can help you resolve this issue with your iOS device:
    iOS: Unable to update or restore
    http://support.apple.com/kb/HT1808
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • HT201263 Get three quarters of the way through recovery mode and then iphone goes back to "Connect to Itunes screen" can someone help please?

    Get three quarters of the way through recovery mode and then iphone goes back to "Connect to Itunes screen" can someone help please?

    Delete the .ipsw file on the computer.
    Put the device in DFU mode.
    Restore as new, once the restore completes, then try restoring from backup.

  • 1616 screen goes black - Help please

    I have just bought a new Nokia 1616. I have worked through all the settings but cannot find the one to stop it turning the screen off after a few minutes of non-use.  The screen goes black and so you don't know if it is switched on or not.  Ideally I would like it to show the clock like my previous model 1600 did.  Help please.

    If you press on the red phone button the time will display on the screen if the phone is on. It will also show you if the phone is locked or not by showing a small key. Press the menu button and the * key as usual to unlock.

  • After update.. i can not start the ipad, when i press agree in the terms ...it will freeze and the screen not working///help please

    after update.. i can not start the ipad, when i press agree in the terms ...it will freeze and the screen not working///help please

    What to Do When Your iPad Won't Turn On
    http://ipad.about.com/od/iPad_Troubleshooting/ss/What-To-Do-When-Your-Ipad-Wo-No t-Turn-On.htm
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    iPad Frozen? How to Force Quit an App, Reset or Restart Your iPad
    http://ipadacademy.com/2010/11/ipad-frozen-how-to-force-quit-an-app-reset-or-res tart-your-ipad
    iPad: Basic troubleshooting
    http://support.apple.com/kb/TS3274
    iOS: Resolving update and restore alert messages
    http://support.apple.com/kb/TS1275
    iPad: Unable to update or restore
    http://support.apple.com/kb/ht4097
     Cheers, Tom

  • Printer help please HP Officejet Pro 8600

    Hi, I have been trying to print some documents.  After pressing the print button it looks like it will print and then I get a message telling me that it is unable to communicate with the printer, however when I have tried to fix the problem  using the HP hardware diagnostics and this asks it to print a test page, it prints a test page.  I then try to re-print my own word documents and it wont print again.  The printer says its connected OK.  PLEASE HELP its driving me insane!

    Hello Budnet,
    Are you seeing "Ink System Failure" or "Priner Failure" error message. It is shown on top of the error message "There is a problem with the printer or ink system" with yello color warning sign.
    If you are seeing "Ink System Failure" error message , please refer to this page.
    If you are seeing "Printer Failure" error message, please view this page.
    -Bryan-
    *I am an HP employee*
    ** Please click "Accept as Solution" if it solved your problem, so others can find it **
    ***Give Kudos to say "Thanks" by clicking on the thumbs up button under my name***

  • White screen of death + labtop screen not working (HELP PLEASE)

    Hello guys and thank you for reading this.
    As you can probably guess, I am no computer pro. I own a HP labtop (A8 quad-core vision AMD). Recently I wanted to log back on it and found out that my screen had broken while I was moving out. I then proceeded to plug my acer screen to it with the blue
    plug (you know the one with the 2 little screws :P) and when I finally logged on I saw that i had what they call the "white screen of death".
    I found out many videos and articles explaining how to get rid of this white screen. Unfortunately, when I start up my PC and press F8, I dont see this on my acer screen, for some reason it goes up only when I can log in to my computer so I can't see the
    Safe mode and everything. 
    It would be my greatest pleasure if someone could help me to get back into my labtop.
    Thank you for your consideration (sorry for the typos english is my 2nd language)<
    Gabriel.

    As per my understanding, boot up screen will come up on primary display. Since, primary is broken so you wont get it in external display. 
    Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
    the thread.

  • White Bar Across My iPod Nano Screen!! HELP PLEASE!

    Theres a thick white bar going horizontally across the screen of my iPod Nano, and I don't know how to get it away. I've restored my iPod, reset it, I don't know what to do. It's driving me crazy! Someone please please PLEASE help me!
    It would be easier if you could email me with help: [email protected]
    Thank you.
    Sarah x

    Time to send it back to Apple:iPod Service Request
    Regards
    Colin R.

  • Mac OS 10.7.5 After download pdf only get 1page when save or print-help please

    I have Mac OS 10.7.5.  After I download I can read the whole pdf.  When I save or print I get only one page.
    When I receive a pdf via email, I can open, save, and print it.
    Please help.

    Canoeless in Panama wrote:
    Why, oh why, when the principal of taking power from a USB port is so well established, do I have to keep buying batteries for both the mouse and the keyboard? OK, so I can, and will replace them, but still, c'mon Apple!
    Are these wireless devices? are they Apple devices?

  • Photosmart D110 and Wifi Printing Help Please!

    I have been told my several different tech support ppl at various stores that I can use my Verizon Mobile Broadband card's WIFI output to print to a wireless printer.  Can someone please provide DETAILED instructions on how to do this?  I have installed the software  but when i try to connect wirelessly it says no network found.  Which is true because i of course do NOT have a network.  I only have my broadband card and WIFI output....??   It's all new to me so i'm not sure what to do.  Thanks in advance!

    OK, I think I understand.  Normally, one wireless radio can connect to one device at a time.  You have two.  One is a VPN connection to the Verizon cellular network with a special radio meant for that.  The other is a standard wifi radio that is connected to your printer.
    You can always come back here for help!
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Built in cam show black screen lenovo G5030 help please

    Hi, please help my bulit in lenovo G5030 cam is showing black screen! the light is on but only black screen!!
    it shows this black screen in the cam utility and also camtasia studo ans skype! nothing works!
    i have tried it with both windows 7 32-bit and now 64-bit
    and i have uninstalled and installed it's driver several times but no joy!
    please help

    I had a similar problem on a Yoga 3 Pro and no matter what I did, it did not work. So I tried a tool that I have had other people run as a malware repair, and it fixed it right up. But I did not write down what the error was. I do not know if this will fix your problem.
    The tool is called Windows Repair (All In One) If you want to give it a try, the instructions are below.
    Download Portable Windows Repair (all in one) from one of the following:
    http://www.tweaking.com/content/page/windows_repai​r_all_in_one.html
    http://www.majorgeeks.com/Tweaking.com_-_Windows_R​epair_Portable_d7222.html
    http://www.bleepingcomputer.com/download/windows-r​epair-all-in-one-portable/
    Unzip the contents into a newly created folder on your desktop. Make sure your AV protection is turned OFF before running the tool....
    Open the folder, run the tool by right click on Repair_Windows (icon with red briefcase) select "Run as Administrator"
    From the main GUI do the following:
    Select Tab 3 and allow it to run Disk check
    Select Tab 4 and allow it to run SFC
    Select Tab 5 and Create System Restore Point
    Select Start Repairs tab => Click the Start
    The repairs window will open, uncheck the boxes as indicated, also the "Restart" option, then select Start...
    DON'T use the computer while each scan is in progress.
    Hoov
    Microsoft MVP - Consumer Security
    SpywareHammer.com

  • [SOLVED] printer help please SOS HELP !!!!

    Recently, I wanted to print something, so I followed the instructions on installing a printer on arch wiki about cups. I followed every piece of instruction, but none did the trick. I even tried installing my printer from hp-toolbox, but it gave me and error saying printer queque failed. I have an HP photosmart c4400. It works for every other OS. Please help.
    Last edited by raj7095 (2010-02-16 22:36:37)

    Is this really so big of an "SOS HELP!!!!" that you need to bump it after 7 minutes? Good policy is to bump after 2 days, if you really can't find anything. Try to provide more information in posts or do more digging and state what you've tried  since the last post. http://wiki.archlinux.org/index.php/For … te#Bumping
    Where does it say "printer queque failed"? Did you really try everything on the wiki page about CUPS? My printer works fine but I don't have the same one as you. Does the wiki page say anything about blacklisting/rmmod-ing modules? I've seen that mentioned in other threads, but I don't know which module. Please wait for somebody that knows, I'm sure somebody can help.

  • All I see is a white screen... (help please)

    I got my ipod nano this october and it worked fine until a couple of weeks ago. I turned my ipod on and it shut down and when I turned it back on again all I got was a simple white screen, nothing else. It's been doing that for about three weeks now. I've tried EVERYTHING The 5 R's everthing, nothing seems to work. I even just let it sit and not be used for a week and it still hasn't worked. It's really angering me. My brother did not pay the money for an ipod for me that doesn't work. Somebody PLEASE, help me.

    See this.
    iPod 5th gen (with video) shows blank or white screen.
    It's not for the nano but worth a try.
    If none of the above help, then it may be an issue that requires service.
    You can arrange online service here.
    Service request.
    Or if an Apple store is near you, take it there and have them check your iPod.

  • Printer for 10.4.11? I can't find a compatible printer. help. please.

    1.42 GHz PowerPC G4. running OS X 10.4.11 I just upgraded RAM to 1GB, but did not change the platform. Ram upgrade has allowed me to use a new HP 4500 officejet "wireless" printer/scanner/fax as a hardwired printer, I but cannot get the scanner software to open (have not attempted fax install). "HP scan" must be launching but it won't open. The icon bounces in the dock then I get the error message "... quit unexpectedly"). I am really not liking this printer since it seems to guzzle ink and has no "draft setting" (it says draft but prints in heavy ink). If anyone can suggest a new printer/scanner that will work, I'd appreciate it.
    Also/Alternatively do you think I should change my platform? I don't have a backup drive so not sure how to proceed.
    I don't know much about computers so please bear with me and also know I am VERY appreciative of your advice.
    Many Thanks,
    Niki

    Answers and solutions are in this article:
    http://www.macworld.com/article/1167965/mountain_lion_and_the_ancient_airport_ba se_station.html
    BTW, you need AirPort Utility 5.6. There is no AirPort Utility 5.7.
    AirPort Utility 5.6 for Mac OS X Lion

  • Printer help please... Canon MP560

    Im new to Mac and have no idea how to set up my printer that is connected to my Windows desktop USB and on my wireless network. My other windows laptops pick it up but this macbook pro os x does not.
    the macbook picks up my network but again i dont even know how to get into my windows shared files.
    any help is appreciated. thanks

    Mac OS X v10.6 Snow Leopard > Printing, faxing and scanning forum is just 6 lines below the forum area you posted in.
    http://discussions.apple.com/forum.jspa?forumID=1344

Maybe you are looking for