Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4256397

Problem with Printing when more than one printer is installed in the system.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.2.0, 1.2.1, 1.2.2
    • Fix Version/s: None
    • Component/s: vm-legacy
    • Labels:
    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      generic, windows_95, windows_98

      Description



      Name: rlT66838 Date: 07/22/99


      Step1:
      Try printing a file with java.awt.print.PrinterJob class. Your
      system should have more than one printer installed and one of
      them should be set to default printer. Now using the print dialog
      if you choose to print from the printer other than the default
      printer you get a fatal error.

      Step2:
      Sorry..I felt the source code can be very simple and can be
      written

      Step3:
      The following error message appeared..
      A nonfatal internal JIT (3.00.078(x)) error 'Structured Exception(c0000090)' has occurred in :
      'java/awt/font/TextLine.getBounds ()Ljava/awt/geom/Rectangle2D;':
      Interpreting method.
      Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cgi

      Step4:
      No information.

      Step5:
      c\>java -version
      java version "1.2"
      Classic VM (build JDK-1.2-V, native threads)
      c\>java -fullversion
      JAVA.EXE full version "JDK-1.2-V"

      Step6:
      No additional configuration information.
      (Review ID: 88232)
      ======================================================================

      Name: skT88420 Date: 09/27/99


      Got this under printing on a HP LaserJet 5000 and use of java.awt.print.*:

      A nonfatal internal JIT (3.10.107(x)) error 'Structured Exception(c0000090)' has
       occurred in :
        'java/awt/geom/AffineTransform.createInverse ()Ljava/awt/geom/AffineTransform;
      ': Interpreting method.
        Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cg
      i


      K:\CCSS\BOSS\ccss>java -fullversion
      JAVA.EXE full version "JDK-1.2.2-W"
      (Review ID: 95778)
      ======================================================================

      Name: krT82822 Date: 10/07/99


      A nonfatal internal JIT (3.00.078(x)) error 'Structured Exception(c0000090)' has occurred in :
        'java/awt/geom/AffineTransform.createInverse ()Ljava/awt/geom/AffineTransform;': Interpreting method.

      I encountered the messege when trying to print an Image to a laser printer. The image did not print where it has previously done so.
      (Review ID: 96242)
      ======================================================================

      Name: krT82822 Date: 02/07/2000


      java version "1.2.2"
      Classic VM (build JDK-1.2.2-001, native threads, symcjit)


      1.- When I add HTML panel with JEditorPane and add a print featur to
      jEditorPane, I have an error when I finish my program.

      3.- A nonfatal internal JIT (3.10.107(x)) error 'Structured Exception
      (c0000090)' has
       occurred in :
        'java/awt/geom/AffineTransform.createInverse ()Ljava/awt/geom/AffineTransform;
      ': Interpreting method.
        Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cg
      i

      2.-
      import java.io.*;
      import java.net.*;
      import java.net.URL;
      import javax.swing.text.html.*;
      import java.util.EventObject.*;

      import javax.swing.*;
      import javax.swing.tree.*;
      import javax.swing.tree.DefaultMutableTreeNode;
      import javax.swing.event.*;

      import java.awt.event.WindowAdapter;
      import java.awt.event.WindowEvent;
      import java.awt.*;
      import java.awt.event.*;

      import javax.swing.text.*;
      import javax.swing.JComponent.*;

      import java.util.StringTokenizer;

      import java.beans.*;
      import java.awt.print.*;


      public class TreeTableExample0 {

          public JPanel mainp;
          public JRootPane rpane;
          public JDesktopPane playe;

          public static final Integer LAYER1 = new Integer(0);
          public static final Integer LAYER2 = new Integer(1);
          public static final Integer LAYER3 = new Integer(2);
          public static final Integer LAYER4 = new Integer(3);

          PrintableEditorPane viewRep;

          public static void main(String[] args) {
      new TreeTableExample0();
          }

          public String getFormat(String stData) {
            if( stData.indexOf(".") >= 0 ) {
              stData = stData.substring(0,stData.indexOf("."));
            }
            return stData.trim();
          }

          public void print() {
            viewRep.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
              PrinterJob job = PrinterJob.getPrinterJob();
              job.setPrintable(viewRep);
              if (job.printDialog()) {
                  try {
                      job.print();
                      }
                  catch (Exception ex) {
                      System.out.println(ex);
                      }
                  }
              viewRep.setCursor(Cursor.getDefaultCursor());
          }


          public TreeTableExample0() {
              mainp = new JPanel();
              mainp.setPreferredSize(new Dimension(700,500));
              mainp.setLayout(new BorderLayout());

              rpane = new JRootPane();
              mainp.add(rpane);

              playe = new JDesktopPane();
              rpane.setLayeredPane(playe);

              JFrame frame = new JFrame("Inventarios Mexmal AS/400");
              final PRODUCTO mpro = new PRODUCTO();
              JTreeTable treeTable = new JTreeTable(new OLS(mpro));
              final JTree arbol = treeTable.getTree();
              JScrollPane jsp = new JScrollPane(treeTable);
              jsp.setPreferredSize(new Dimension(695,400));
              jsp.setBounds(0,0,jsp.getPreferredSize().width, jsp.getPreferredSize
      ().height);
              playe.add(jsp, LAYER1);
              JButton jb0 = new JButton("Imprimir");
              jb0.setBounds(10, 410, jb0.getPreferredSize().width,
      jb0.getPreferredSize().height );
              playe.add(jb0, LAYER2);
              jb0.setActionCommand("jb0");
              jb0.addActionListener(new ActionListener() {
                 public void actionPerformed(ActionEvent e) {
                   if( e.getActionCommand().equals("jb0") ) {
                     TreePath[] selp = arbol.getSelectionPaths();
                     if( selp == null) return;
                    try {
                     PrintWriter htmlf = new PrintWriter( new FileWriter
      ("/data.html") );
                       htmlf.println("<HTML>");
                         htmlf.println("<BODY>");
                           htmlf.println("<FONT COLOR=\"BLUE\" FACE=\"Arial\" SIZE=\"1
      \">");
                           htmlf.println("MEXMAL INVENTARIOS EN LINEA");
                           htmlf.println("<BR>");
                           if( (selp.length == 1) )
                            if ( (selp[0].toString().trim().equalsIgnoreCase
      ("[Mexmal.- Inventarios En-Linea.]")) ) {
                               htmlf.println("<TABLE BORDER=1>");
                               for(int j = 0; j <= (mpro.list().length - 1); j++) {
                                   htmlf.println("<TR>");
                                    htmlf.println("<TD COLSPAN=8>");
                                     htmlf.println("<FONT COLOR=\"BLACK\" SIZE=\"1
      \">");
                                     htmlf.println(mpro.list()[j].trim());
                                     htmlf.println("</FONT>");
                                    htmlf.println("</TD>");
                                   htmlf.println("</TR>");
                                   StringTokenizer tkn = new StringTokenizer(mpro.list
      ()[j],"|");
                                   String cl1 = null;
                                   String cln = null;
                                   if( tkn.hasMoreTokens() ) cl1 = tkn.nextToken();
                                   if( tkn.hasMoreTokens() ) cln = tkn.nextToken();
                                   if( cln != null) {
                                     for(int r = 0; r <= (mpro.getBuffer().length-1);
      r++) {
                                      if( mpro.getBuffer()[r].indexOf(cln) >= 0) {
                                        String t1 = null;
                                        String t2 = null;
                                        String t3 = null;
                                        String t4 = null;
                                        StringTokenizer tkn1 = new StringTokenizer
      (mpro.getBuffer()[r],"|");
                                        if( tkn1.hasMoreTokens() ) t1 = tkn1.nextToken
      ();
                                        if( tkn1.hasMoreTokens() ) t2 = tkn1.nextToken
      ();
                                        if( t2 != null ) {
                                         if( t2.trim().equals( cln.trim() ) ) {
                                          ItemProduct im = new ItemProduct(mpro,
      mpro.getBuffer()[r]);
                                          htmlf.println("<TR>");
                                          htmlf.println("<TD>");
                                          htmlf.println("<FONT COLOR=\"BLACK\"
      SIZE=\"1\">");
                                          htmlf.println(im.getNoParte().trim());
                                          htmlf.println("</FONT>");
                                          htmlf.println("</TD>");
                                          htmlf.println("<TD>");
                                          htmlf.println("<FONT COLOR=\"BLACK\"
      SIZE=\"1\">");
                                          htmlf.println(im.getDescription().trim());
                                          htmlf.println("</FONT>");
                                          htmlf.println("</TD>");
                                          htmlf.println("<TD>");
                                          htmlf.println("<FONT COLOR=\"BLACK\"
      SIZE=\"1\">");
                                          htmlf.println(getFormat(im.getMTY()));
                                          htmlf.println("</FONT>");
                                          htmlf.println("</TD>");
                                          htmlf.println("<TD>");
                                          htmlf.println("<FONT COLOR=\"BLACK\"
      SIZE=\"1\">");
                                          htmlf.println(getFormat(im.getTOR()));
                                          htmlf.println("</FONT>");
                                          htmlf.println("</TD>");
                                          htmlf.println("<TD>");
                                          htmlf.println("<FONT COLOR=\"BLACK\"
      SIZE=\"1\">");
                                          htmlf.println(getFormat(im.getCHI()));
                                          htmlf.println("</FONT>");
                                          htmlf.println("</TD>");
                                          htmlf.println("<TD>");
                                          htmlf.println("<FONT COLOR=\"BLACK\"
      SIZE=\"1\">");
                                          htmlf.println(getFormat(im.getAGS()));
                                          htmlf.println("</FONT>");
                                          htmlf.println("</TD>");
                                          htmlf.println("<TD>");
                                          htmlf.println("<FONT COLOR=\"BLACK\"
      SIZE=\"1\">");
                                          htmlf.println(getFormat(im.getLAR()));
                                          htmlf.println("</FONT>");
                                          htmlf.println("</TD>");
                                          htmlf.println("<TD>");
                                          htmlf.println("<FONT COLOR=\"BLACK\"
      SIZE=\"1\">");
                                          htmlf.println(getFormat(im.getPUE()));
                                          htmlf.println("</FONT>");
                                          htmlf.println("</TD>");
                                          htmlf.println("</TR>");
                                         }
                                        }

                                      }
                                     }
                                   }
                               }
                               htmlf.println("</TABLE>");
                           }
                         htmlf.println("</FONT>");
                         htmlf.println("</BODY>");
                       htmlf.println("</HTML>");
                     htmlf.close();
                    } catch( IOException ioe) {}

                     viewRep = new PrintableEditorPane();
                     viewRep.setEditable(false);
                     viewRep.addHyperlinkListener( new HyperlinkListener() {
                       public void hyperlinkUpdate(HyperlinkEvent evt) {
                         if( evt.getEventType() ==
      HyperlinkEvent.EventType.ACTIVATED ) {
                          JEditorPane pane = (JEditorPane) evt.getSource();
                         if( evt instanceof HTMLFrameHyperlinkEvent ) {
                           HTMLFrameHyperlinkEvent evt1 = (HTMLFrameHyperlinkEvent)
      evt;
                           HTMLDocument doc = (HTMLDocument) pane.getDocument();
                           doc.processHTMLFrameHyperlinkEvent(evt1);
                         } else {
                            try {
                              pane.setPage( evt.getURL());
                            }catch(Throwable t) {
                                 t.printStackTrace();
                             }
                          }
                        }
                       }
                     }
                     );
                     JScrollPane viewRepJS = new JScrollPane(viewRep);
                     viewRepJS.setPreferredSize(new Dimension(695,300));
                     try {
                      viewRep.setPage( new URL("file:///data.html"));
                     } catch(IOException mue) {
                         System.out.println( "Error: " + mue.getMessage() );
                      }

                     JInternalFrame vr = new JInternalFrame("Visor de reportes
      (HTML)", false, true, false, false);
                     JPanel vrp = new JPanel();
                     vrp.setPreferredSize( new Dimension(700,400) );
                     vrp.add(viewRepJS);
                     JButton okp = new JButton("OK");
                     okp.setActionCommand("print");
                     okp.addActionListener( new ActionListener() {
                       public void actionPerformed(ActionEvent e) {
                         if( e.getActionCommand().equals("print") ) {
                            print();
                         }
                       }
                     });
                     vrp.add(okp);
                     vr.addInternalFrameListener(new InternalFrameAdapter() {
                         public void internalFrameClosing(InternalFrameEvent e) {
                         }

                         public void internalFrameOpened(InternalFrameEvent e) {
                         }

                         public void internalFrameClosed(InternalFrameEvent e) {
                         }

                         public void internalFrameIconified(InternalFrameEvent e) {
                         }

                         public void internalFrameDeiconified(InternalFrameEvent e) {
                         }

                         public void internalFrameActivated(InternalFrameEvent e) {
                         }

                         public void internalFrameDeactivated(InternalFrameEvent e) {
                         }

                     });
                     vr.getContentPane().add(vrp);
                     vr.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                     vr.setBounds(10,10,600,400);
                     vr.pack();
                     vr.setVisible(true);
                     vr.show();
                     playe.add(vr, LAYER4);
                   }
                 }
              });

      frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent we) {
      System.exit(0);
      }
      });
              frame.getContentPane().add(mainp);
      frame.pack();
      frame.show();
          }
      }
      (Review ID: 100914)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rlewis Roger Lewis (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: