I cannot get a JTEXTArea to print in LANDSCAPE

How do I get this to work properly. I need the JTextArea to print out in Landscape not portrait.
public void printReport() {
                  display.getText();
                  PrinterJob job = PrinterJob.getPrinterJob();
                  PageFormat pageFormat  = job.defaultPage();
                  pageFormat.setOrientation(PageFormat.LANDSCAPE);
                 job.setPrintable(new Printable() {
                      public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
                              throws PrinterException {
                          if (pageIndex > 0) {
                              return Printable.NO_SUCH_PAGE;
                          } else {
                               ((Graphics2D)graphics).translate(pageFormat.getImageableX(), pageFormat.getImageableY());
                               display.print(graphics);
                               return Printable.PAGE_EXISTS;
                  try {
                      job.print();
                      printReport.setEnabled(false);
                  catch (PrinterException printError) {
                      printError.printStackTrace();
    }

This problem solved. NOw it will only print 1 Page. HOw do I print more than 1 page???
public void printReport() {
              display.getText();
             PrinterJob job = PrinterJob.getPrinterJob();
             PageFormat pageFormat  = job.defaultPage();
            pageFormat.setOrientation(PageFormat.LANDSCAPE);
     pageFormat = job.pageDialog(pageFormat);
             job.setPrintable(new Printable() {
              public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
                         throws PrinterException {
                     if (pageIndex > 0) {
                         return Printable.NO_SUCH_PAGE;
                     } else {
                          ((Graphics2D)graphics).translate(pageFormat.getImageableX(), pageFormat.getImageableY());
                          display.print(graphics);
                          return Printable.PAGE_EXISTS;
             try {
                 job.print();
                 printReport.setEnabled(false);
             catch (PrinterException printError) {
                 printError.printStackTrace();
    }

Similar Messages

  • When I try to click on print in Mapquest and PDF documents I cannot get the popup to print the page

    When I try to click on print in Mapquest and PDF documents I cannot get the popup to print the page when I click on "print."
    I have to type the URL in Google Chrome browser and the print button works fine.
    How can I get the print popup to work in Firefox 6.0?

    My sister's 5s is having the same issue since yesterday.
    Neither resetting via holding home+power buttons helped, nor the "reset all settings" in the settings. The only option left is erasing the iPhone and setting it up as a new phone ( or restoring from a backup?)

  • I cannot get my ipad to print using my wi if printer. It works with my computer

    I cannot get my iPad to print with my wifi printer but it prints from my computer

    Is your printer listed on this page as supporting AirPrint : http://support.apple.com/kb/HT4356 ?
    If it doesn't support AirPrint then you could see if the printer manufacturer has their own app in the store which supports it (e.g. Epson have an iPrint app, and HP have an ePrint app). If not then there are third-party printer apps such as Print n Share and PrintCentral Pro which might work with it

  • Cannot get pdf file to print actual size

    I recently had to reinstall my printer and now when printing PDF files I cannot get the page to print in full size.  This is necessary because I am printing a pattern and the size has to be accurate.  I am not even given the option anymore to be able to do this.  I did have the option before the reinstall.  BTW the reinstall is because the computer crashed and I had to take back to factory settings.  I appreciate any help given.  Thanks.

    pamw523
    Welcome back to the HP Community Forum.
    This may be helpful:
    Manage Print Output with Print Preview
    Assuming you have installed the Full Feature Software for the printer
    and
    Assuming that you have at least a recent version of Adobe Reader or Adobe software installed so you can download and open PDF files,
    then
    it may only be that the PDF print setup needs to be adjusted for the file prior to printing
    See pages 5 and 6
    You can also check
       Print PDFs
    ===========================================================
    Click the Kudos Thumbs-Up to say Thank You!
    And...Click Accept as Solution when my Answer provides a Fix or Workaround!
    I am pleased to provide assistance on behalf of HP. I do not work for HP. 
    Kind Regards,
    Dragon-Fur

  • I cannot get my iphone to print on 8500 officejet.

    Just bought an Office Pro 8500A got it all set up but, cannot get my IPhone to find the printer.  I have turn off the bluetooth, loaded the lastest software on the IPhone, turned off and on the printer, router, phone, and reset the WEP secure code on the printer for my wireles router.  My compac laptop print wireless.  Lost.

    What router?  Do not use WEP, it is not in the least secure.  Switch your security to WPA with a 13+ character password.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Cannot get HP C8180 to print from Windows XP

    It prints fine in Lepoard, but cannot even set it up in Windows when I boot from mac using bootcamp.
    I tried wired/wireless and it will not install any drivers.
    Is this a bootcamp issue?
    Thanks
    Frank

    Well, the only way I got this to work was using usb and plugging it into my airport express and then use bonjour. The network option did not work or wireless.
    I ended up returning the C8180 and getting a MP970.
    Frank

  • Cannot get my PSC 1350 printer operating anymore from OS 10.6.3

    I have been facing quite an unexpected regression over the last couple of days
    My kid told me the scanner option of PSC 1350 All-in-One was not working anymore. After some basic testing I arrived to the same conclusion.
    I re-installed the printer using the HP installer disk (dated 2005) and could restore the scanner function successfully. Did a Print Test from the HP Director S/W and the test printed successfully. Unfortunately the normal print function from an application (TextEdit, Safari, etc.) regressed and I fail to get it working again until now.
    Self-test of the printer is OK. I also repaired permissions with the Disk Utility. But no improvement.
    Actually the symptom was when I tried to print, the file falls immediately in the queue list with error. But no error code or anything that could help to follow a track appears, this is why I am now begging some help to Mac wizards
    I tried so many different configurations that I pass the historical details. This is driving me mad and this is where I am presently : I uninstalled all HP software and refreshed the printers list. Then I retrieved a PSC 1300 series driver for Mac OX X 10.6 on HP service website with a light of hope that it could finally fix the problem : Inkjet710_6_Print_Mac1.dmg
    I ran installation SW and it reported successful installation.
    The problem is now that I cannot retrieve any trace of the HP Installer presumably installed and the HP procedure never says clearly in which folder the HP Installer is due to copy.
    Could anyone provide me with a clean procedure to :
    1. check where the HP Installer may have been written, as running this HP Installer may hopefully be the end of my problems
    Else
    2. how to cleanse trace of any previous printer installation
    3. how re-install from scratch the PSC 1300 series driver in a way that it prints successfully under Mac OS 10.6.3 other than using the HP Installer above.
    Thanks in advance to who may help me to get out of the maze.

    Gilou, I would suggest calling HP tech support, as this appears to be a problem with the printer, rather than with Snow Leopard. Good luck!

  • Cannot get computer to discover printer

    Okay so a couple weeks ago I got an HP Officejet pro plus 8600 and have been having connectivity problems.
    a bit of background
    I have a macbook pro running 10.7.5
    and a belkin n150 router
    we also have an older desktop mac running snow leopard
    Okay so from the beginning I was having problems getting the printer to actually print wirelessly. I was able to discover the printer by adding it to the print & scan under default. However at the time which was a few weeks ago it would give me the error message that it was offline and wouldn't print. Now heres the tricky part. I did something dealing with IP address that was recomended to me on an HP forum and it worked! That day I was able to print no problem.
    A week later I open up my macbook and attempt to print and I am getting the same problem i.e. when I looked at the print que:
    1. Menu says "looking for printer"
    2. Menu says printing job 1% complete, barber pole scrolls
    3. Menu says printer not responding
    so I looked online for what to do.
    I went to HP and followed the instructions from the link below.
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02205477&cc=us&dlc=en&lang= en&lc=en&product=4323648#N12058
    Because it seems that the printer is connecting to the wifi, I deleted the printer from the que and restarted my computer. I then did a power reset on the printer.
    Ever since I deleted the printer from the que I have not been able to discover anything at all when I click the + in the print and fax menu.

    Thanks for replying. Just to claify, when we try to connect the iPod to the computer via usb, when using the usb cable that came with the iPod, nothing at all transpires. I check and the computer does not recognize the device. When using another usb cable she purchased locally, we get the notice that the device cannot be loaded. It will be a day or two before I get down to them, so just wanted to run this by you. In the meantime, I will try your suggestions.

  • Cannot get Samsung ML1740 to print wirelessly

    Hi everyone,
    Am new to the Apple. I have a Dell PC running Vista with my Samsung ML1740 printer attached via USB. I have a router and wireless network. I have a MacBook Pro and would like to be able to print wirelessly through my network. Right now I can print if I use the USB port. How can I go about doing this? If you can walk me through the process it will be appreciated.

    The following is several steps you can follow. Note that I have made the assumption that you already have your MacBook Pro connected via wireless to the same network as the Dell. If this is not the case then please reply.
    First thing you will need to do is share the printer in Vista and keep the share name to something short and preferably without spaces, such as ML1740. You should also check that the Guest account is enabled, as you will be asked to authenticate when you connect to the share from the Mac.
    With the printer shared you can then open System Preferences > Print & Fax on the Mac and click the + to add a queue. With the new window that appears you will see several icons, such as Default, Fax, IP and Windows. Select the Windows icon. This will show a window with three columns. The first column will show the workgroup names of the computers on the same network as the Mac. If you don't see any workgroup names then you don't have the Mac on the same network as the Dell. If you do see the workgroup name then select it and this will show the Dell computer name in the next column. When you select the Dell's name you will get prompted to authenticate. Select Guest and OK. This should now make the shared name appear in the third column. Select this and see what the Print Using menu does. This could be the last problem as many vendors printer drivers are written for direct connections only - not for connecting via Windows shares. So if you do select the ML1740 in the Print Using menu but find you cannot print then the problem is most likely due to the driver. See how you go with the above and if you get stuck at any point then please reply.

  • Cannot get text file to print in jtable. Using text file as a database

    Instead of doing JDBC i am using text file as database. I cant get data from text file to print into JTable when i click find button. Goal is to find a record and print that record only, but for now i am trying to print all the records. Once i get that i will change my code to search desired record and print it. when i click the find button nothing happens. Can you please take a look at my code, dbTest() method. thanks.
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.util.*;
    import java.io.*;
    public class GUIdirectory extends JFrame
    implements ActionListener {
    // Define the components and the layout
    JLabel inputLabel_lastname = new JLabel("Last Name");
    JTextField inputText_lastname = new JTextField("Last Name",15);
    JLabel inputLabel_firstname = new JLabel("First Name");
    JTextField inputText_firstname = new JTextField(" ",15);
    JLabel inputLabel_middleinitial = new JLabel("Middle Initial");
    JTextField inputText_middleinitial = new JTextField(" ",4);
    JButton inputButton = new JButton("Find");
    JPanel inputLayout = new JPanel(new FlowLayout(FlowLayout.CENTER,5,5));
    JButton jButton1 = new JButton();
    //create a new table and scrollpane
    JTable dataTable = new JTable();
    JScrollPane dataTableScrollPane = new JScrollPane();
    public static void main(String args[]) {
    GUIdirectory gui = new GUIdirectory("Telephone Directory");
    gui.show();
    gui.pack();
    //TokenTest tt = new TokenTest();
    //gui.dbTest();
    public GUIdirectory(String Title) {
    super(Title);
    // Add ourselves as a listener for the window closing
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    exitWindow(1); }
    inputLabel_lastname.setLabelFor(inputText_lastname);
    inputText_lastname.setHorizontalAlignment(JTextField.RIGHT);
    inputText_lastname.addActionListener(this);
    inputLabel_firstname.setLabelFor(inputText_firstname);
    inputText_firstname.setHorizontalAlignment(JTextField.RIGHT);
    inputText_firstname.addActionListener(this);
    inputLabel_middleinitial.setLabelFor(inputText_middleinitial);
    inputText_middleinitial.setHorizontalAlignment(JTextField.RIGHT);
    inputText_middleinitial.addActionListener(this);
    inputButton.addActionListener(this);
    inputLayout.add(inputLabel_lastname);
    inputLayout.add(inputText_lastname);
    inputLayout.add(inputLabel_firstname);
    inputLayout.add(inputText_firstname);
    inputLayout.add(inputLabel_middleinitial);
    inputLayout.add(inputText_middleinitial);
    inputLayout.add(inputButton);
    getContentPane().setLayout(new BorderLayout(5,5));
    getContentPane().add("North",inputLayout);
    dataTableScrollPane.setViewportView(dataTable);
    getContentPane().add("Center",dataTableScrollPane);
    // A default method, primarily used for testing.
    public void actionPerformed(ActionEvent evt) {
    GUIdirectory gui = new GUIdirectory();
    gui.dbTest();
    void dbTest() {
    DataInputStream dis = null;
    String dbRecord = null;
    String hold;
    try {
    File f = new File("customer.txt");
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    dis = new DataInputStream(bis);
    Vector dataVector = new Vector();
    Vector headVector = new Vector(2);
    Vector row = new Vector();
    // read the record of the text database
    while ( (dbRecord = dis.readLine()) != null) {
    StringTokenizer st = new StringTokenizer(dbRecord, ",");
    while (st.hasMoreTokens()) {
    row.addElement(st.nextToken());
    System.out.println("Inside nested loop: " + row);
    System.out.println("inside loop: " + row);
    dataVector.addElement(row);
    System.out.println("outside loop: " + row);
    headVector.addElement("Title");
    headVector.addElement("Type");
    dataTable = new JTable(dataVector, headVector);
    dataTableScrollPane.setViewportView(dataTable);
    } catch (IOException e) {
    // catch io errors from FileInputStream or readLine()
    System.out.println("Uh oh, got an IOException error!" + e.getMessage());
    } finally {
    // if the file opened okay, make sure we close it
    if (dis != null) {
    try {
    dis.close();
    } catch (IOException ioe) {
    } // end if
    } // end finally
    } // end dbTest
    // Exits the program upon closing the window
    public void exitWindow(int i) {
    System.exit(i);
    public GUIdirectory() {
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    private void jbInit() throws Exception {
    jButton1.setText("jButton1");
    this.getContentPane().add(jButton1, BorderLayout.CENTER);

    Nothing happens because in the actionPerformed() method you are creating a new version of GUIdirectory. You just want to execute the dbTest() method of the current instance of GUIdirectory.
    The code should be:
    public void actionPerformed(ActionEvent evt)
    //GUIdirectory gui = new GUIdirectory();
    //gui.dbTest();
    dbTest();

  • I cannot get an Adobe pdf printer to correctly install in windows 7 64 bit

    I purchased Acrobat Pro XI and installed and it went fine.  I then installed my copy of Master Collection 5.5, it didn't install Acrobat X, and the printer disappeared.  I have tried to repair my XI installation, but it won't do it, and I have tried to uninstall it to reinstall it, but it won't let me do that either.  I cannot find the location for a correct Adobepdf.inf file wherte it is supposed to be.  I find two in windows/system32/driverstore, but they do not work correctly.

    Hi stampguy,
    You might want to refer the thread : Re: Manually installing  PDF Printer  to add printer manually.
    Usually repairing Acrobat brings the pdf printer back.
    Please try updating to the latest patch 11.0.7 and check.
    Regards,
    Rave

  • I cannot get my photo to print for this reason -there is a photo in this print job which is missing its source file

    I'm working in lightroom to print cards with a custom print size.  When I set up the printer I get a message that reads "There is one photo in the print job which is missing its source file".  The preview shows my card as blank.  What is wrong?

    I would believe what the message is saying, that a photo is missing.  Do you know what photo you're trying to print, and if you look at this photo in Library, does it have a question mark on the thumbnail or other indication that the preview is there but the master photo is gone/moved?

  • I cannot get my Epson R800 printer to work with Lion

    I have updated to Lion and now I cannot print on my Epson stylus photo R800. Trying to add a printer goes out to find software only to tell me to go to Epson. Going to Epson only tells me that if there is no software then I already have it.
    Any ideas
    Alastair

    Did you follow the links of what to do, Lion FAQ on Epson?
    Selected FAQ
    Q:
    I don't see my product listed on the Epson Mac OS X Lion Support page. Can I use my product with Mac OS X Lion?
    A:
    If your product isn't listed in any of the drop-down lists on the Mac OS X Lion Support page, it is not currently compatible with Lion.
    It's 5-10 years or thereabouts? I've had laser printers newer than that be rendered legacy obsolete and lack of drivers. Of course all my new scanners, printers are 10x faster and better, too. And my last Canon half the cost was in the ink! but great buy for $80. Refills though are $45+.

  • Cannot get Pages to let printer manage the color

    This is actually a Pages '06 issue, but the Pages'06 discussion is closed so I could not post this question there.
    I am leaving out a lot of hsitory to be as brief as possible, but I will say this much. I did have Leopard installed, but this OS X had an issue with Painter X so I removed Leopard and re-installed Tiger. There is a documented conflict with Painter X that Apple and Corel have not been able to rectify. I use Painter to put beans on the table, so I had no choice but to re-install Tiger. Whether this is the cause of my problem, I do not know. Here is my current dilemma.
    All of my Pages prints use to print perfectly. Now, no matter what I do, they are flat and dull. I would like to use my ICC Color Profiles to manage my color rather than allow Pages to color manange.
    To be clear all of my ink cartridges are fresh and all printer nozzles are clear. Many tests have been run on my Epson R2400 and none have shown any problems whatsoever.
    What I believe may be the problem here is that in the Print / ColorSync /Color Conversion pull-down menu, 'Standard' is my only choice. 'In Printer' is the only other option, but it is grayed out, unselectable. The Pages manual states that:
    'Standard: Uses the default settings in Pages ...
    'In Printer: Lets the printer ... control color management ...
    Does anyone know what may be a solution to making 'In Printer' selectable?? Am I overlooking something? I could almost print in Pages with my eyes closed and get perfect prints every time. But that has all changed for some reason.
    Pages'08 does not even have a ColorSync option in its print menu which gives me pause to wonder, but if anyone has a suggestion about using Pages'08 and my problem, then I all ears. In addition, the Pages'08 manual does not even have printing instrctions, so this was no help either.
    Any help or suggestions will be greatly appreciated.

    There is a documented conflict with Painter X that Apple and Corel have not been able to rectify. I use Painter to put beans on the table, so I had no choice but to re-install Tiger.
    OK, if you are using the ICC architecture for a living, and if you have a problem with a file format / application, you need to talk to the Apple ColorSync Users List.
    What I believe may be the problem here is that in the Print / ColorSync /Color Conversion pull-down menu, 'Standard' is my only choice. 'In Printer' is the only other option, but it is grayed out, unselectable. The Pages manual states that:
    'Standard: Uses the default settings in Pages ...
    'In Printer: Lets the printer ... control color management ...
    This is incorrect. The correct interface information is, "In Printer: Lets the PostScript interpreter control colour management". You do not have a printer with a built-in PostScript interpreter, so the system computes the colourant conversion. Hence, In Printer is grayed out.
    Does anyone know what may be a solution to making 'In Printer' selectable?? Am I overlooking something?
    Sure, buy an Adobe CPSI (Configureable PostScript Software Interpreter) running on a Mac server or Windows server, or but one that comes as an embedded controller in a colour printer, and you can use the command 'In Printer'.
    Pages'08 does not even have a ColorSync option in its print menu which gives me pause to wonder,
    Thankfully, since Pages should not have its own ICC API, but should be a client of the system in general and the ColorSync Utility in particular. What Pages does not have is object-level ICC source profile assignment, and object-level rendering intent settings.
    You can get this, but if you make a mistake, you kill your colours. For instance, if you select Absolute Colorimetric as rendering intent, you match the white point of the source colour space into the graybalance and clip the lightness linearly to the lightness of the printing condition.
    By hiding rendering intent settings, you get a fairly foolproof situation.
    In addition, the Pages'08 manual does not even have printing instrctions, so this was no help either.
    Printing instructions are the property of the printer manufacturer who plugs a printer driver into the system. What you can argue, and many would agree, is that configuration of the ColorSync Utility and the Display control panel is underdocumented. But that in itself is a bit of a job.
    /hh

  • HT4623 cannot get my phone to print to air printer

    After i updated my iphone it does not let me print from my emails.  It tells me I cannot locate my printer.  Any help would be great

    Put the devices in pairing mode.
    Read the Owner's manual for those devices to determine how to put them in pairing mode.

Maybe you are looking for