Print JTable problem

I want to print a JTable, so that i use the code from http://java.sun.com/developer/onlineTraining/Programming/JDCBook/advprint.html java sun tutorial and it workds correctly....but i would want to create the JTable and not display it. In this case, when i print this, no data is printed.
If someone knows a solution...
Thanks a lot

I have seen before where you have to make sure that you JTable has been "realized". There is some magic that happens once your component is added to a Frame/Dialog and then setSize or pack is called on that window. To fix this I would just use a non-visible window ex...
JFrame frm = new JFrame();
frm.setContentPane(new JScrollPane(print_table));
frm.pack();
//now print the print_tableI would try that ...
Hope this helps...
Josh Castagno
http://www.jdc-software.com

Similar Messages

  • Printing JTable problem

    hi
    i have a problem in printing jtable
    after printing the box around the table only printed and the content of the table isn't
    instead there is a wight space in the box
    can any one help me

    In fact the program i'm making is for printing preview
    it's three classes i found in one of the topics , then i modified them to preview a table
    here is my code : \\ the class "TPrintPreview" needs a JTable object as an argument
    ********************************TPrintPreview.java************************************************************
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Cursor;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.image.BufferedImage;
    import java.awt.print.PageFormat;
    import java.awt.print.Paper;
    import java.awt.print.Printable;
    import java.awt.print.PrinterException;
    import java.awt.print.PrinterJob;
    import java.text.MessageFormat;
    import javax.swing.JTable;
    import javax.swing.JTable.PrintMode;
    * @author  TAREQ145
    public class TPrintPreview extends javax.swing.JFrame {
       int m_wPage;
       int m_hPage;
        /** Creates new form TPrintPreview */
        public TPrintPreview(JTable table) {
            initComponents();
            PageFormat m_pageFormat = PrinterJob.getPrinterJob().defaultPage();//use PageDialog
            m_wPage = (int)(m_pageFormat.getWidth());
            m_hPage = (int)(m_pageFormat.getHeight());
            int scale = getScale(5);  //Scale Index = 100
            jComboBox1.setSelectedIndex(5);
            int w = (int)(m_wPage*scale/100);
            int h = (int)(m_hPage*scale/100);   
            int pageIndex = 0;
            try{
            while (true) {
                int theFirstImageWidth = table.getColumnModel().getTotalColumnWidth()+1;
                BufferedImage img = new BufferedImage(theFirstImageWidth, theFirstImageWidth+180, BufferedImage.TYPE_INT_RGB); 
                Graphics g = img.getGraphics();
                g.setColor(Color.white);
                g.fillRect(0, 0, theFirstImageWidth , theFirstImageWidth+180);//180 = height - width
                Paper p = new Paper();
                p.setImageableArea(0,0,theFirstImageWidth,theFirstImageWidth+180);
                m_pageFormat.setPaper(p);
                Printable  m_target = table.getPrintable(PrintMode.FIT_WIDTH,null,new MessageFormat("- {0} -"));
               if (m_target.print(g, m_pageFormat, pageIndex) != Printable.PAGE_EXISTS) {
                   img = null;
                   break;
                int rightOrLeftSpace = 25;
                int upOrDownSpace = 25;
                int theSecondImageWidth = theFirstImageWidth + (rightOrLeftSpace*2);
                BufferedImage img2 = new BufferedImage(theSecondImageWidth, theSecondImageWidth+180, BufferedImage.TYPE_INT_RGB); 
                Graphics g2 = img2.getGraphics();
                g2.setColor(Color.white);
                g2.fillRect(0, 0, theSecondImageWidth, theSecondImageWidth+180);
                g2.drawImage(img,rightOrLeftSpace,upOrDownSpace,null); 
                Image img3 = img2.getScaledInstance(m_wPage,m_hPage,Image.SCALE_SMOOTH);
                PagePreview pp = new PagePreview(w, h, img3);
                previewContainer1.add(pp);
                //pp = null;
                pageIndex++;
                img = null;
                g = null;
            } catch (PrinterException e)   {
              e.printStackTrace();
             System.err.println("Printing error: "+e.toString());
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
            jLabel1 = new javax.swing.JLabel();
            jScrollPane1 = new javax.swing.JScrollPane();
            previewContainer1 = new PreviewContainer();
            jButton1 = new javax.swing.JButton();
            jComboBox1 = new javax.swing.JComboBox();
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("Print Preview");
            jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24));
            jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
            jLabel1.setText("Print Preview");
            jLabel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
            javax.swing.GroupLayout previewContainer1Layout = new javax.swing.GroupLayout(previewContainer1);
            previewContainer1.setLayout(previewContainer1Layout);
            previewContainer1Layout.setHorizontalGroup(
                previewContainer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 752, Short.MAX_VALUE)
            previewContainer1Layout.setVerticalGroup(
                previewContainer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 511, Short.MAX_VALUE)
            jScrollPane1.setViewportView(previewContainer1);
            jButton1.setText("EXIT");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "10 %", "25 %", "30 %", "50 %", "75 %", "100 %", "125 %", "150 %", "175 %", "200 %" }));
            jComboBox1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jComboBox1ActionPerformed(evt);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 754, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 754, Short.MAX_VALUE))
                            .addContainerGap())
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(183, 183, 183)
                            .addComponent(jButton1)
                            .addGap(74, 74, 74))))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 513, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(40, 40, 40)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jButton1)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(80, Short.MAX_VALUE))
            pack();
        }// </editor-fold>                       
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            this.dispose();
        private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {                                          
            int scale = getScale(jComboBox1.getSelectedIndex());
                      int w = (int)(m_wPage*scale/100);
                      int h = (int)(m_hPage*scale/100);
                      Component[] comps = previewContainer1.getComponents();
                      for (int k=0; k<comps.length; k++) {
                         if (!(comps[k] instanceof PagePreview)) continue;
                         PagePreview pp = (PagePreview)comps[k];
                         pp.setScaledSize(w, h);
                      previewContainer1.doLayout();
                      getContentPane().validate();
        private int getScale(int scaleIndex) {
          int scale = 10;
          String[] scales = { "10 %", "25 %", "30 %", "50 %", "75 %", "100 %" , "125 %","150 %","175 %","200 %"};
          if (scaleIndex>-1 && scaleIndex<scales.length) {
             String str = scales[scaleIndex];
             if (str.endsWith("%"))str = str.substring(0, str.length()-1);
             str = str.trim();
             try { scale = Integer.parseInt(str); }
             catch (NumberFormatException ex) { ex.printStackTrace();}
          return scale;
        // Variables declaration - do not modify                    
        private javax.swing.JButton jButton1;
        private javax.swing.JComboBox jComboBox1;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JScrollPane jScrollPane1;
        private PreviewContainer previewContainer1;
        // End of variables declaration                  
    ********************************PreviewContainer.java************************************************************
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Insets;
    import javax.swing.JPanel;
    * PreviewContainer.java
    * Created on 04 &#1603;&#1575;&#1606;&#1608;&#1606; &#1575;&#1604;&#1579;&#1575;&#1606;&#1610;, 2008, 10:20 &#1605;
    * @author  TAREQ145
    public class PreviewContainer extends JPanel {
        protected int H_GAP = 16;
        protected int V_GAP = 10;
        /** Creates new form BeanForm */
        public PreviewContainer() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
        }// </editor-fold>                       
          public Dimension getPreferredSize() {
             int n = getComponentCount();
             if (n == 0) return new Dimension(H_GAP, V_GAP);
             Component comp = getComponent(0);
             Dimension dc = comp.getPreferredSize();
             Dimension dp = getParent().getSize();
             int nCol = Math.max((dp.width - H_GAP) / (dc.width + H_GAP), 1);
             int nRow = n / nCol;
             if ((nRow * nCol) < n) nRow++;
             int ww = nCol * (dc.width + H_GAP) + H_GAP;
             int hh = nRow * (dc.height + V_GAP) + V_GAP;
             Insets ins = getInsets();
             return new Dimension(ww+ins.left+ins.right, hh+ins.top+ins.bottom);
          public Dimension getMaximumSize() {
             return getPreferredSize();
          public Dimension getMinimumSize() {
             return getPreferredSize();
          public void doLayout() {
             Insets ins = getInsets();
             int x = ins.left + H_GAP;
             int y = ins.top + V_GAP;
             int n = getComponentCount();
             if (n == 0) return;
             Component comp = getComponent(0);
             Dimension dc = comp.getPreferredSize();
             int w = dc.width;
             int h = dc.height;
    //fl+ 03.09.2003
             if (getParent() == null) return;
    //fl-        
             Dimension dp = getParent().getSize();
             int nCol = Math.max((dp.width-H_GAP)/(w+H_GAP), 1);
             int nRow = n/nCol;
             if (nRow*nCol < n) nRow++;
             int index = 0;
             for (int k = 0; k<nRow; k++) {
                for (int m = 0; m<nCol; m++) {
                   if (index >= n) return;
                   comp = getComponent(index++);
                   comp.setBounds(x, y, w, h);
                   x += w+H_GAP;
                y += h+V_GAP;
                x = ins.left + H_GAP;
        // Variables declaration - do not modify                    
        // End of variables declaration                  
    ******************************PagePreview.java***********************************************************************************
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.Insets;
    import javax.swing.JPanel;
    * PagePreview.java
    * Created on 04 &#1603;&#1575;&#1606;&#1608;&#1606; &#1575;&#1604;&#1579;&#1575;&#1606;&#1610;, 2008, 10:25 &#1605;
    import javax.swing.border.MatteBorder;
    * @author  TAREQ145
    public class PagePreview extends JPanel {
         protected int m_w;
         protected int m_h;
         protected Image m_source;
         protected Image m_img;
        /** Creates new form BeanForm */
        public PagePreview() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
        }// </editor-fold>                       
        public PagePreview(int w, int h, Image source) {
             m_w = w;
             m_h = h;
             m_source = source;
             m_img = m_source.getScaledInstance(m_w, m_h, Image.SCALE_SMOOTH);
             m_img.flush();
             setBackground(Color.white);
             setBorder(new MatteBorder(1, 1, 2, 2, Color.black));
          public void setScaledSize(int w, int h) {
             m_w = w;
             m_h = h;
             m_img = m_source.getScaledInstance(m_w, m_h, Image.SCALE_SMOOTH);
             repaint();
          public Dimension getPreferredSize() {
             Insets ins = getInsets();
             return new Dimension(m_w+ins.left+ins.right,
                m_h+ins.top+ins.bottom);
          public Dimension getMaximumSize() {
             return getPreferredSize();
          public Dimension getMinimumSize() {
             return getPreferredSize();
          public void paint(Graphics g) {
             g.setColor(getBackground());
             g.fillRect(0, 0, getWidth(), getHeight());
             g.drawImage(m_img, 0, 0, this);
             paintBorder(g);
        // Variables declaration - do not modify                    
        // End of variables declaration                  
    }please help me
    thankz

  • Is it possible to print JTable and custom JPanel on the same page?

    Hello everybody!
    I have a custom panel extending JPanel and implementing Printable.
    I am using paint() method to draw some graphics on it's content pane. I would like to print it, but first I would like to add a JTable at the bottom of my panel. Printing just the panel goes well. No problems with that.
    I was also able to add a JTable to the bottom of JFrame, which contains my panel.
    But how can I print those two components on one page?

    Hi, thanks for your answer, but I thought about that earlier and that doesn't work as well... or mybe I'm doing something wrong. Here is the sample code:
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.print.PageFormat;
    import java.awt.print.Printable;
    import java.awt.print.PrinterException;
    import java.awt.print.PrinterJob;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    public class ReportFrame extends JFrame implements Printable {
         private static final long serialVersionUID = -8291124097290245799L;
         private MyPanel rp;
         private JTable reportTable;
         private HashPrintRequestAttributeSet attributes;
         public ReportFrame() {
              rp = new MyPanel();
              String[] columnNames = { "Column1", "Column2", "Column3" };
              String[][] values = { { "Value1", "Value2", "Value3" }, { "Value4", "Value5", "Value6" }, { "Value7", "Value8", "Value9" } };
              reportTable = new JTable(values, columnNames);
              add(rp, BorderLayout.CENTER);
              add(reportTable, BorderLayout.SOUTH);
              setTitle("Printing example");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setPreferredSize(new Dimension(700, 700));
              pack();
              setVisible(true);
         @Override
         public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
              if (pageIndex >= 1)
                   return Printable.NO_SUCH_PAGE;
              Graphics2D g2D = (Graphics2D) graphics;
              g2D.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
              return Printable.PAGE_EXISTS;
         public static void main(String[] args) {
              new ReportFrame().printer();
         class MyPanel extends JPanel implements Printable {
              private static final long serialVersionUID = -2214177603101440610L;
              @Override
              public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
                   if (pageIndex >= 1)
                        return Printable.NO_SUCH_PAGE;
                   Graphics2D g2D = (Graphics2D) graphics;
                   g2D.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
                   return Printable.PAGE_EXISTS;
              @Override
              public void paint(Graphics g) {
                   super.paintComponent(g);
                   Graphics2D g2D = (Graphics2D) g;
                   int x = 0, y = 0, width = 70, height = 70;
                   for (int i = 0; i < 50; i++) {
                        g2D.drawOval(x + i * 10, y + i * 10, width, height);
         public void printer() {
              try {
                   attributes = new HashPrintRequestAttributeSet();
                   PrinterJob job = PrinterJob.getPrinterJob();
                   job.setPrintable(this);
                   if (job.printDialog(attributes))
                        job.print(attributes);
              } catch (PrinterException e) {
                   JOptionPane.showMessageDialog(this, e);
    }UPDATE:
    I've managed to get this to work, by calling 2 methods inside the outer frame's print method (lines 78 and 79)
    Those two methods are:
    rp.paint(g2D);
    reportTable.paint(g2D);but still it is not the way I would like it to be.
    First of all both the ReportPanel and ReportTable graphics are printed with the upper-left corner located in the upper-left corner of the JFrame and the first one is covering the second.
    Secondly, I would like to rather implemet the robust JTable's print method somehow, because it has some neat features like multipage printing, headers & footers. But I have no idea how to add my own graphics to the JTables print method, so they will appear above the JTable. Maybe someone knows the answer?
    Thanks a lot
    UPDATE2:
    I was googling nearly all day in search of an answer, but with no success. I don't think it's possible to print JTable using it's print() method together with other components, so I will have to think of something else i guess...
    Edited by: Adalbert23 on Nov 22, 2007 2:49 PM

  • Print JTable with row headers

    I am using the fancy new printing capablities in java 1.5 to print my JTable and wow is it ever slick!
    PrintRequestAttributeSet set = new HashPrintRequestAttributeSet();
    set.add(OrientationRequested.LANDSCAPE);
    this.matrixJTable.print(JTable.PrintMode.NORMAL, null, null, true, set, false);Its just that easy. Way to go sun!
    The one problem that I am encountering is that my row headers don't print. The problem is that JTables don't support row headers, you have to use a JScrollPane for that.
    I need a way to print my JTable so that the row headers show up in the printout... and hopefully still use the warm and fuzzy new printing capabilities of JTable printing in java 1.5.
    (ps/ Isn't it time to add row header support to JTables?)

    The problem is that JTables don't support row headers, you have to use a JScrollPane for that.Well technically JTable's don't really support column headers either. It is a seperate component (JTableHeader). A JTable will automatically add its table header to the table header area of a JScrollPane. (but you don't have to use a jscrollpane to see the column headers, it is just the quickest and easiest way).
    Really shouldn't be hard to implement a row header and manually add it to the scroll panes row header area or use a BorderLayout and put your row header in the WEST and put your table in the CENTER if you don't want a scroll pane.
    Of course this won't help you with your printing issue.

  • Print JTable with column heading

    Hi,
    I'm very new to this JTable. I'm try to print a Jtable using the print() function (from JDK 1.5)
    JTable.print(JTable.PrintMode.FIT_WIDTH, new MessageFormat(
    _tabledata.getTitle() ),
    new MessageFormat("Page {0,number}"));
    The problem I have is that some time it print and other time it doens't print. Also, if it doesn't print, then the program become very slow or not respond. Is that the probelm with the new JDK or am I doing something wrong?
    Thanks for you help.

    Don't rely on JTable.print() methods too much.
    Sadly Sun didn't think anyone would need to print anything from java so support was added late and half heartedly (programmers hate printing stuff)
    If you are new to java you need to focus on something simpler than printing documents; unfortunatly printing is a tedious burdonsome task for experreineced developers
    for example: learn how to output your data from a table into an HTML formate/file; you can build beautiful reports/printouts easily and view them in java components easily but you will probably want to print them from a browser.
    Even if you find a class or two to help with your printing efforts on the net you will find you need to know many other generic complicated aspects of java to continue
    Sean

  • Print Quality problems

    My print quality for Reds & Greens is coming out streaked. The blacks and blues are fine. I use HP ink cartridges anad keep them cleaned and aligned. But on the Alignment page the reds & greens are streaked and cannot be cognized. Could this be a print head problem ? 

    Hello novemberwolf,
    Welcome to the HP Forums.
    I see that you are having some printing issues when attempting to print in colour.
    Please click on the following link on Fixing Print Quality Problems for the HP Officejet Pro 8600 e-All-in-One Printer Series.
    If the troubleshooting does not help resolve your issue, I would then suggest calling HP's Technical Support to see about further options for you. If you are calling within North America, the number is 1-800-474-6836 and for all other regions, click here: click here.
    Thanks for your time.
    Click the “Kudos Thumbs Up" at the bottom of this post to say “Thanks” for helping!
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    W a t e r b o y 71
    I work on behalf of HP

  • Print quality problems on Fuji Xerox printers when printing from ArchiCAD and/or Preview.

    Hello,
    We experience major print quality problems when printing directly from Graphisoft's ArchiCAD, Nemetscheks Vectorworks and from Apple's Preview.
    Basically we see various artefacts on our printed drawings, e.g. line thicknesses change and hatched patterns / fills are reproduced with patches where the lineweights and clours change completely... which is not acceptable.
    This affects the following Fuji Xerox printer models on both 10.6.x and 10.7.x with the latest FJX PPDs:
    ApeosPort C5540I
    Xerox LF6605 MF
    The workarounds for us are to either print PDFs from Adobe Acrobat Reader or via the rather dated Accxess Tools, besides that we prefer at times to print directly from a given Software it is also not always possible to generate a PDF and print it from Acrobat Reader... especially since the latest Adobe Reader update to its print dialogue makes printing from it extremely tedious - in fact we are considering going back to 9.5.2
    Obviously, we have approached FJX Tech Support and are awaiting a reply - however we are disappointed that this is happening on relatively new equipment and wonder if anybody else has already found a solution.

    The symptoms you mention could be related to the FJX engine and Acrobat is masking this fault. To test, you can create a Postscript file from the print dialog of ArchiCAD or VectorWorks and then download this to the Apeos RIP. If this produces the same result as when using the printer driver from the applications, then it would indicate that the engine is not capable of handling the data being sent to it from these applications.

  • Print Cartridge Problem: Tricolor - HP Officejet J4680 All In One

    I am seriously going to have an anxiety attack. I run a business from home & I HAVE to have a printer. I just spent $50 on new ink cartridges. My printer was working fine for the last week, and then tonight I have this error message:
    Print cartridge problem: [Tri Color] . Refer to device documentation to troubleshoot
    SO I reset the printer, shut it on and off, cleaned the cartridge and the printer, switched out the new cartridge with the old one ~ same problem. Over and over.
    I called HP and they said that since my printer is out of warranty they can't help me unless I purchase a new warranty plan. What horrible customer service. This printer is a product of HP and I should be able to get help regardless of when the warranty expired.
    This is so frustrating. If I can't get help, I think I would rather buy a new printer of a different brand instead of paying for a warranty after I just spent 50 bucks on ink. GRRR!

    The page here has troubleshooting steps that may resolve your issue.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • Windows 8/8.1: Printer Offline Problems

    Windows 8/8.1: Printer Offline Problems
    Are you getting an error that your network or wireless printer is offline when you try to print?
    When you print to your network printer, does it fail, and when you check the printer status it says Offline?
    Do you have problems printing to your wireless printer after your PC has been asleep?
    If you answered YES to any of the above questions, then you have a problem with your network printer being offline.  After some investigation into this problem, we recommend updating windows.  Run Windows update to check that your version of Windows 8 is up to date.
    There are a few windows updates that may help with this problem
    1)    Install this Microsoft patch to make sure this private-public-private network issue does not reoccur. It is part of the April 2014 Windows Update package for Windows 8.1 and Server2012 R2 (http://support.microsoft.com/kb/2919355).
    2)      Install this Microsoft patch for the WSD service.  http://support.microsoft.com/kb/3000461
    If this does not help, then please follow the steps list below which will give you a Workaround that may help with this problem.
    Assign the printer a static IP address
    An IP address is an Internet network address that the computer can use to communicate with the printer. Enter a static IP address to make sure that the wireless connection remains stable. Follow these steps to assign the printer a static IP address.
    Get the printer IP address.
    Press the Wireless button on the printer control panel to view the network settings.
    Access the Network menu on the printer control panel.
    Print a Network Configuration Page or Wireless Test Report page.
    Once you have the printer's IP address, open a new web browser window or tab.
    Type the IP address in your web browser's address bar, and then press Enter.
    Make sure that you type the IP address into the browser's address box. If you type it into a tool bar search box, the EWS will not open.
    If the message 'There is a problem with this website's security certificate' appears in the web browser when you try to open the embedded web server (EWS), or when you navigate within the EWS, click ' Continue to this website (not recommended)'.
     note:
    Choosing 'Continue to this website (not recommended)' will not harm your computer while you navigate within the EWS for your printer. If you encounter this error outside of your printer's EWS, your computer could be at risk.
    If the browser fails to open the EWS after you click 'Continue to this website (not recommended)', refresh the browser window.
    The Embedded Web Server (EWS) for the printer opens and confirms that the printer is on the same network as the computer.
    In the EWS, click the Network tab.
    In the Wireless section, click the Network Address (IP) or IPv6 configuration, depending on your network setup.
    Click Manual IP, and then click Suggest a Manual IP Address. A manual IP address, Subnet Mask, and Default Gateway displays.
    After the manual IP address populates, click Manual DNS Server.
     note:
    Keep a record of the manual IP address for reference.
    On the Network Configuration Page you printed earlier, locate the DNS Server addresses, type the DNS addresses in the Manual Preferred DNS Server and Manual Alternate DNS Server fields, and then click Apply.
    If the DNS addresses are not listed on the Network Configuration Page, or if you have trouble accessing the network or Internet with the original DNS addresses, use one of the following methods to obtain DNS addresses.
    Method one: Use publicly available DNS server addresses
    Configure the printer using publicly available DNS server addresses. To find available DNS server addresses, search online for 'public DNS servers'.
    After you find public DNS server addresses, type the addresses in the Manual Preferred DNS Server and Manual Alternate DNS Server fields, and then click Apply.
    Method two: Get the network DNS information via your computer
    Select your operating system, and then use the following directions to obtain the DNS server addresses.
    Right-click the Start button () or the lower left corner of the screen, click Run, type cmd, and then press Enter.
    When the command window opens, type ipconfig /all, and then press Enter. Information about the computer's network displays.
    Scroll to and locate the DNS Server addresses.
    In the EWS, type the DNS addresses in the Manual Preferred DNS Server and Manual Alternate DNS Server fields, and then click Apply.
    Print a test page to make sure that the printer's IP address is the same as you assigned.
    Right-click the Start button () or the lower left corner of the screen, click Search, type HP and click your printer in the results. Click Utilities, and then click Update IP address to update the address in the software.
    Adding a Wireless Network Printer using Control Panel
    Go to Control Panel and choose Devices and Printers
    Click on Add Printer
    The PC will search the local network and display the network printers.
    Choose the printer and select Next
    The system will then try and auto select a compatible driver
    Select the current driver and Click Next
    The system will then ask for a name for the printer. The user can change the name and then click Next
    The User can then choose to share the printer
    The user can select to make this new printer the default and then click Finish.
    The new printer is now setup but this printer may be using the In OS driver (Class) rather than the HP Full Function driver.
    To change the printer to use the HP Full Function driver follow the following instructions. I would recommend changing the driver to the HP Full Function driver as the User can then use features such as Custom paper sizes.
    Go back into Control Panel and choose devices and Printers, right click on the newly created printer and choose Printer Properties
    Choose the Advanced Tab
    Click on the driver section drop down and choose the Driver for the printer that does not have the words Class driver after it.
    Click apply and then OK and the driver will be changed to the HP Full Function driver for the printer.
    The user should try this configuration and see if they still experience problems.
    Please Note:
    DO NOT Remove the Original Printer Icon from Devices and Printers as the HP Printer Assistant will stop working.
    JonW
    I work for HP

    I have the printer offline problem. It started when I ran out of toner. I have now installed a new toner cartridge.
    Your solution does not help me because I have tried to install Win8.1 and it failed.
    I would just reinstall my printer but I have a long list of items in my print queque and I don't want to lose them.
    Is there another solution? 
    Or is there a way I can save the print queue?
    Mike

  • Windows 7 - HP Laserjet 8500 print driver problem

    I have tried everything imaginable to correct this HP 8500n print driver problem with no success, please help!
    I cannot correct or get rid of a reoccurring “Incompatible Print Settings” error dialog box message that repeatedly states that “There are one or more conflicting settings. One of the settings is: Output Bin: Mailbox 1, Accessory Output Bin: Not Installed”. The radio button options are “Restore my previous settings or Keep this setting, and I will change it later”. This same dialog message repeats 13 times for all the other various conflicts each time you click on printer properties to change to 2 sided printing or any other printer settings. This printer does not have any of these features attached or set into it.
    I am a volunteer that manages a number of computers on our small church LAN, 2 computers operating on MS XP-SP3, 2 on MS Windows 7 Home Premium and my 2 problem computers that came pre-installed with Vista Home Premium of which I have performed an HP OEM upgrade to Window 7.
    I have isolated this print driver problem to the Vista operating system and even when computers are upgraded to Windows 7 does not correct this driver error. I have also tried every possible print driver variant of the HP 8500, HP8550, PCL, PS to include the Microsoft versus HP versions with no success. In each case I get this error yet neither of the XP computers or the computers that had Windows 7 as a original operating system have no problems with their print drivers for this printer.
    Yes, I have repeatedly searched and upgraded the operating system and print drivers. In desperation I have even tried to find the correctly behaving Windows 7 print driver and transfer it to these Vista upgraded to Windows 7 machines. However I could not isolate the driver location.
    The only thing I can conclude is that this errant HP print driver was resident within Vista and remains resident even after a HP OEM Windows 7 upgrade. Additionally, all of these computers are configured to access this printer via its static IP address on the network.  The XP computers are 32 bit, all of the Vista upgraded to Win 7 and OEM Win 7 computers are 64 bit machines all with respective OS. 
    Can anyone please help me correct this problem?

    Hi, 
    Unfortunately I can't see your uploaded image yet as it is awaiting approval from HP.
    From what I can see you are correct that HP does supply drivers for this printer and that the drivers for your printer are already included with Windows 7.  On the machines affected, try the procedure below to see if it helps at all
    Next download revo uninstaller on the link below and install it.
    http://www.revouninstaller.com/download-freeware-version.php
    Disconnect the printer from the PC.
    Run Revo and see if it finds any  HP Printer Software installed.  If it does, right click the software icon and select uninstall.  During the process you may be asked to delete registry entries.  If you are, just select all and click delete.  Do the same for any left over files and folders.  Once completed, reboot the PC.
    Re-connect your printer to the PC and follow the guide below.
    http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?&objectID=c02536257
    If this helps you will need to repeat the process on each of the affected machines.
    Best wishes,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Officejet Pro L7590 Print Quality Problems - Black/Yellow Printhead

    Officejt Pro L7590 All-In-One
    Running on Windows 7 64 bit, USB connected to computer
    Approx 2.5 yrs old; has printed 30,000 pages.
    Issue:  Black/Yellow printhead replaced about 500-1000 pages ago; new unit only tested as "Fair" in diagnostics, even though it was fresh outta the box.  Print Quality good.
    About two weeks ago, printer refused to print, flashing ambler "!", etc., error message regarding black/yellow printhead.
    Ordered replacement ($71 again -- ouch!  Whole printer only cost $199 30 months ago).Again, new unit only "fair" in diagnostic (original Cyan/Magenta printhead still reads as "good"). 
    New printhead required much cleaning and aligning, and now prints with large gaps on a regular basis down the page.  Talked to tech guy @ Staples where i bought it; his only "helpful" suggestion was that most people just toss the printers the first time the printheads go bad.
    Print heads are separately warranted.
    My questions:
    (1)  What else is there that's screwing up my print quality,a nd is it fixable?
    (2)  Can i get my $ back on the two printheads that didn't fix the printer's problems?

    I've included a link below to help you troubleshoot rpint quality issues...
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=bpu03037&tmp_task=solveCategory&lc=en&dlc=en&cc=...
    This document provides some system settings that may help fix the issue.
    Dave M.
    Say Thanks by clicking the Kudos Star in the post that helped you.
    Please mark the post that solves your problem as Accepted Solution.
    I am an HP employee.

  • How to print (on paper) expected header and footer while printing Jtable

    Hello,
    I am printing jtable on paper using dot mtix printer.In header i want to print some name date and number like below
    Sun
    Date:12/8/20010 No.12334
    | col1 | col2 |
    | col1 | col2 |
    footer
    When i am trying to print header its Font size is very big and its in one line.How i can use expected font and expected text here.
    i am using jtable print method(which contin header and footer printing facility)
    Edited by: Ashtekar on Aug 12, 2010 5:18 AM

    I also once hoped for an easy way to modify a table's header and footer, but found no way.
    Yet it is possible.

  • Printing quality problem with Photosmart D110

    The printing quality is very bad after we changed the catridge. The printer keeps saying that there is catridge jam. But after I followed the steps by the printer, the problem is still unsolved. What is the possible reason and how could I solve it?

    Hello RussellYang.
    Welcome to the HP Forums! I understand your concerns with your Photosmart D110A. Does this issue occur from multiple program(s) or just one program?
    Please follow this entire HP document on Continuous Pages of Strange or Garbled Characters Print in Windows.
    What is your operating system on your computer? Click here to find out: Windows.
    Have you tried using a different USB cord, to verify if the issue still occurs?
    Please inform me your troubleshooting steps.
    I worked on behalf of HP.

  • Deskjet 3520e all in one printer network problems

    Hi All.
    I have a brain teaser for the technical types out there hoping someone can shed some light on a weird sort of problem.
    History: All has been fine with my g6 Pavillion latop 64bit W8 and 3520e all in one printer and working as always very well.
    Oct 16th 2014 My broadband service went down and after many communictions with ISP eventualy received (Nov 4th) and installed a new "super hub modem".
    OK so far, Managed to connect laptop via wireless router and connect to internet etc., however . . . I cannot get my printer to network as before, I can use it via USB port but if I try to network it, The Cyan ink cartridge reports as being broken or damaged even though 3/4 full and will not allow printing, but when connect via USB port the Cyan ink cartridge registers normal and will print as expected.
    Has anyone else come across this problem?
    If I go down the route of uninstalling and reinstallin the Printer software is there a set order in which to do so?
    In the list of programs these four are shown. . 
    HP Deskjet 3520 series Basic Device Software
    HP Deskjet 3520 series Help
    HP Deskjet 3520 series Product Improvement Study
    HP Deskjet 3520 series Setup Guide.
    I would like very much to get back to network printing if at all possible.
    The router IP address is 192.168.1.3
    The printer IP address is 192.168.0.1
    I have been led to believe that as the addresses are so close this shouldnt be the cause.
    I must add that in the past I have had occasional printer software problems which I was unable to resolve without help from the technical centre and I would prefer not to restart the installation if at all possible.
    Your comments would be appreciated.
    Thanks in advance.
    Un1corn.

    Hi @Un1corn 
    What exactly happens when you try to convert from USB to Wireless and configure the printer to the Virgin Media Super Hub? Do you get an error message of some sort?
    Maybe there is a firewall on the Super Hub. Do you have the model number for this device? I can look up some information to see what could be casing the issue.
    In the meantime, running the Print and Scan Doctor might help. The HP Print and Scan Doctor is a free utility (tool) that helps to quickly resolve common printing, scanning and connectivity issues including but not limited to:
    Connectivity:
    USB: Verifies that the USB connection from your computer to the HP product is working correctly.
    Network: Verifies that the network connection between your computer and your network is working correctly.
    Device Status Test: Checks for device errors such as out of paper, paper jams, carriage stalls, and paper feed issues, and then provides instructions for fixing the error.
    Driver Check: Checks for missing or corrupt driver files.
    Device Manager: Checks for problems in Device Manager that would prevent printing.
    Device Online: Checks if the product has been paused or set to offline, and then sets the status back to online if necessary.
    Print Queue: Checks for and clears pending print jobs in the print queue (a log of print jobs waiting to print).
    Port Match: Checks the port settings for the HP product.
    Device Conflicts: Checks for conflicts with other drivers, such as other printer brands.
    Ink Issues: Checks the cartridges and ink levels for issues that affect print quality.
    Print Settings: Checks and adjusts the print quality settings.
    Test Print: Prints a test page for print quality evaluation, and provides options for cleaning and aligning the printhead if necessary.
    Scan Tests: Checks the scan mechanism, drivers, and registry entries.
    Source:Try the HP Print and Scan Doctor for Windows
    Click here to download and run the Print and Scan Doctor> www.hp.com/go/tools
    If that does not resolve the issue, post back and let me know if there are any symbols other than green check marks and what they are next to of course. The wrench is not always easy to spot as the wrench and the check mart are in the green circle.
    If you see only green check marks (), the tool did not find any problems.
    If you see green wrenches (), the utility identified an issue and corrected it automatically.
    If you see yellow exclamation points (), the test failed and required user action, but the step was skipped.
    If you see a red X (), follow the on-screen instructions to resolve the issue.
    I look forward to hearing back from you.
    Please click the Thumbs up icon below to thank me for responding.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Sunshyn2005 - I work on behalf of HP

  • Image in header of print (JTable)

    Hello,
    I have a question about printing a JTable. I use the following code which works well but I want to extend my print with a image (a logo) in the header of every page. What is the best way to achieve this?
    My second question is how I can change the font size of the header?
    Thanks for your reply.
    Regards Stefan.
    MessageFormat header = new MessageFormat("Test");
    MessageFormat footer = new MessageFormat("Page - {0}");
    try {
        if (!myTable.print(JTable.PrintMode.FIT_WIDTH
    , header, footer, true, null, true)) {
            System.err.println("User cancelled printing");
    } catch (java.awt.print.PrinterException e) {
        System.err.format("Cannot print %s%n", e.getMessage());
    }     

    The API provided by the JTable class is described as simple, and indeed it is. To obtain more complex printing, you need to use the JTable.getPrintable method and do some extra work to get the results desired.
    There are also several third party codes you can try. Do a search on google to search what you find
    ICE

Maybe you are looking for