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

nonfatal internal JIT (3.00.078(x)) error 'Structured Exception(c0000090)' has

    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
    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      generic, windows_95, windows_98

      Description

      nt.ActionListener;
      import java.awt.event.ActionEvent;
      import java.awt.*;
      import java.awt.geom.*;
      import java.awt.print.*;

      public class SimpleBook extends JPanel implements ActionListener{

         final static Color bg = Color.white;
          final static Color fg = Color.black;
          final static Color red = Color.red;
          final static Color white = Color.white;

          final static BasicStroke stroke = new BasicStroke(2.0f);
          final static BasicStroke wideStroke = new BasicStroke(8.0f);

          final static float dash1[] = {10.0f};
          final static BasicStroke dashed = new BasicStroke(1.0f,
                                                            BasicStroke.CAP_BUTT,
      BasicStroke.JOIN_MITER,
                                                            10.0f, dash1, 0.0f);
          final static JButton button = new JButton("Print");

         public SimpleBook() {
             setBackground(bg);
              button.addActionListener(this);
         }

        public void actionPerformed(ActionEvent e) {

          // Get a PrinterJob
          PrinterJob job = PrinterJob.getPrinterJob();
          // Create a landscape page format
          PageFormat landscape = job.defaultPage();
          landscape.setOrientation(PageFormat.LANDSCAPE);
          // Set up a book
          Book bk = new Book();
          bk.append(new PaintCover(), job.defaultPage());
          bk.append(new PaintContent(), landscape);
          // Pass the book to the PrinterJob
          job.setPageable(bk);
          // Put up the dialog box
          if (job.printDialog()) {
              // Print the job if the user didn't cancel printing
              try { job.print(); }
                  catch (Exception exc) { /* Handle Exception */ }
          }
      }

          public void paintComponent(Graphics g) {
              super.paintComponent(g);
              Graphics2D g2 = (Graphics2D) g;
              drawShapes(g2);
          }

          static void drawShapes(Graphics2D g2){
              int gridWidth = 600 / 6;
              int gridHeight = 250 / 2;
              
              int rowspacing = 5;
              int columnspacing = 7;
              int rectWidth = gridWidth - columnspacing;
              int rectHeight = gridHeight - rowspacing;
              
              Color fg3D = Color.lightGray;
           
              g2.setPaint(fg3D);
              g2.drawRect(80, 80, 605 - 1, 265);
              g2.setPaint(fg);
                   
              int x = 85;
              int y = 87;
       
          
              // draw Line2D.Double
              g2.draw(new Line2D.Double(x, y+rectHeight-1, x + rectWidth, y));
              x += gridWidth;
              
      Graphics2D temp = g2;
              // draw Rectangle2D.Double
              g2.setStroke(stroke);
              g2.draw(new Rectangle2D.Double(x, y, rectWidth, rectHeight));
              x += gridWidth;
              
              // draw RoundRectangle2D.Double
              g2.setStroke(dashed);
              g2.draw(new RoundRectangle2D.Double(x, y, rectWidth,
                                                  rectHeight, 10, 10));
              x += gridWidth;
              
              // draw Arc2D.Double
              g2.setStroke(wideStroke);
              g2.draw(new Arc2D.Double(x, y, rectWidth, rectHeight, 90,
                                       135, Arc2D.OPEN));
              x += gridWidth;
              
              // draw Ellipse2D.Double
              g2.setStroke(stroke);
              
              g2.draw(new Ellipse2D.Double(x, y, rectWidth, rectHeight));
              x += gridWidth;
              
              // draw GeneralPath (polygon)
              int x1Points[] = {x, x+rectWidth, x, x+rectWidth};
              int y1Points[] = {y, y+rectHeight, y+rectHeight, y};
             GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD,
                                                    x1Points.length);
              polygon.moveTo(x1Points[0], y1Points[0]);
              for ( int index = 1; index < x1Points.length; index++ ) {
                  polygon.lineTo(x1Points[index], y1Points[index]);
              };
              polygon.closePath();
              
              g2.draw(polygon);

              // NEW ROW
              x = 85;
              y += gridHeight;
              
              // draw GeneralPath (polyline)
              
              int x2Points[] = {x, x+rectWidth, x, x+rectWidth};
              int y2Points[] = {y, y+rectHeight, y+rectHeight, y};
              GeneralPath polyline = new GeneralPath(GeneralPath.WIND_EVEN_ODD,
                                                     x2Points.length);
              polyline.moveTo (x2Points[0], y2Points[0]);
             for ( int index = 1; index < x2Points.length; index++ ) {
                  polyline.lineTo(x2Points[index], y2Points[index]);
              };
              
              g2.draw(polyline);
              x += gridWidth;
                                                    
              // fill Rectangle2D.Double (red)
              g2.setPaint(red);
              g2.fill(new Rectangle2D.Double(x, y, rectWidth, rectHeight));
              g2.setPaint(fg);
              x += gridWidth;
              
              // fill RoundRectangle2D.Double
              GradientPaint redtowhite = new GradientPaint(x,y,red,x+rectWidth,y,white);
              g2.setPaint(redtowhite);
              g2.fill(new RoundRectangle2D.Double(x, y, rectWidth,
                                                  rectHeight, 10, 10));
              g2.setPaint(fg);
              x += gridWidth;
              
              // fill Arc2D
              g2.setPaint(red);
              g2.fill(new Arc2D.Double(x, y, rectWidth, rectHeight, 90,
                                       135, Arc2D.OPEN));
              g2.setPaint(fg);
              x += gridWidth;
                  
              // fill Ellipse2D.Double
              redtowhite = new GradientPaint(x,y,red,x+rectWidth, y,white);
              g2.setPaint(redtowhite);
             g2.fill (new Ellipse2D.Double(x, y, rectWidth, rectHeight));
              g2.setPaint(fg);
              x += gridWidth;
              // fill and stroke GeneralPath
              int x3Points[] = {x, x+rectWidth, x, x+rectWidth};
              int y3Points[] = {y, y+rectHeight, y+rectHeight, y};
              GeneralPath filledPolygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD,
                                                          x3Points.length);
              filledPolygon.moveTo(x3Points[0], y3Points[0]);
              for ( int index = 1; index < x3Points.length; index++ ) {
                  filledPolygon.lineTo(x3Points[index], y3Points[index]);
              };
              filledPolygon.closePath();
              g2.setPaint(red);
              g2.fill(filledPolygon);
              g2.setPaint(fg);
              g2.draw(filledPolygon);
      g2.setStroke(temp.getStroke());
          }



        public static void main(String[] args) {
              WindowListener l = new WindowAdapter() {
                      public void windowClosing(WindowEvent e) {System.exit(0);}
                      public void windowClosed(WindowEvent e) {System.exit(0);}
              };
              JFrame f = new JFrame();
              f.addWindowListener(l);
              JPanel panel = new JPanel();
              panel.add(button);
              f.getContentPane().add(BorderLayout.SOUTH, panel);
              f.getContentPane().add(BorderLayout.CENTER, new SimpleBook());
              f.setSize(775, 450);
              f.show();
        }

      }

      class PaintCover implements Printable {
        Font fnt = new Font("Helvetica-Bold", Font.PLAIN, 48);

        public int print(Graphics g, PageFormat pf, int pageIndex)
              throws PrinterException {
          g.setFont(fnt);
          g.setColor(Color.black);
          g.drawString("Sample Shapes", 100, 200);
          return Printable.PAGE_EXISTS;
        }
      }

      class PaintContent implements Printable {
        public int print(Graphics g, PageFormat pf, int pageIndex)
        throws PrinterException {
            SimpleBook.drawShapes((Graphics2D) g);
            return Printable.PAGE_EXISTS;

        }


      }
      (Review ID: 95296)
      ======================================================================

      Name: krT82822 Date: 09/30/99


      This is the error that 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

      I'm trying to print a JPanel that contains a 2D graphic. Sorry, that's all the information I can give.

      ----------

      9/30/99 eval1127@eng -- likely a dupe of 4245537 or 4256397
      (Review ID: 95983)
      ======================================================================

      Name: skT88420 Date: 10/11/99


      I tried to program a texteditor using JTextPane and coded this
      subclass:

      ...

      class Editor extends JEditorPane implements Printable
      {

      public Editor (StyledDocument doc)
      {
      ...
      }

      public void printPage()
      {
      PrinterJob printJob = PrinterJob.getPrinterJob();
      printJob.printDialog())
      {
      ...

      printJob.print();
      }
      }

      public int print(Graphics g, PageFormat pf, int pi) throws PrinterException
      {
      if (pi > 1) return Printable.NO_SUCH_PAGE;

      Graphics2D g2 = (Graphics2D)g;
      g2.translate(pf.getImageableX(), pf.getImageableY());
      ...

      and here occurs this mistake every time:

      A nonfatal internal JIT (3.00.078(x)) error 'Structured Exception(c0000090)' has occured in:
      'java/awt/font/TextLine.getBounds ()LJava/awt/geom/Rectangle2D;':
      Interpreting method
      (Review ID: 96350)
      ======================================================================

      Name: krT82822 Date: 11/16/99


      C:\jdk1.2.2\bin>java -version
      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, native threads, symcjit)



      1. the bug occurs faintly the steps that run. it occurs when the method is
      called (stringWidth(String)) for the a printer (it isn't a display).

      2. The source:
      public void dibuja (Graphics2D g){

      g.setFont(fonte);
      FontMetrics fm = g.getFontMetrics();
      int x =pos.x;
      int y = pos.y;
      //Fuentes utilizadas: (I use the next fonts:)
      //new Font("Monospace",Font.PLAIN,6);
      //new Font("Courier",Font.PLAIN,24)
      int w = fm.stringWidth(nome); // AQU? se produce el ERROR al
      dibujar en IMPRESORA
      int h = fm.getHeight();

      g.setColor(colorFondo);
      g.fill(new Rectangle(x - w/2, y - h / 2, w, h));
      g.setColor(colorFonte);
      g.drawString(nome, x - w/2, (y - h/2) + fm.getAscent());
      }
      3. Error Message in the Ms-Dos Console:

      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


      4.

      Only occurs when prints in a printer under LAN, in others printers there aren't
      bug (local printers and printers shared under windows 95). The printer of the
      bug has a admin server printer.

      5.

      The printer which occurs the bug is:
      HP ColorLaserJet 5/5M version F 1.300 - Windows 95.
      Administrada por HP JetDirect y JetAdmin

      In my program the error only abort the printer, the program continue aren't
      problems. But not prints and it's very important.
      (Review ID: 97895)
      ======================================================================

      Name: krT82822 Date: 11/16/99


      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.

      When executing the java Program ,Report.java at
      http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/advpr
      int.html ,it crashed with the above mentioned error message.

      ----------

      4245537, 4256397
      (Review ID: 97941)
      ======================================================================

      Name: skT88420 Date: 12/08/99


      java version "1.2"
      Classic VM (build JDK-1.2-V, native threads)
        Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cg
      i



      this actually one example which ive dowloaded from the tutorial called
      SimpleBook.java, error appears only when print method is called.
      This is the exact message upon calling print

      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.cg
      i
      (Review ID: 98794)
      ======================================================================

      Name: skT88420 Date: 12/14/99


      Dear sir while executing the following program an error as follows is coming at
      randomly but not all the times.On our windows-95 it is showing an "illegal
      operation in application and getting crashed"
      ___________________________________-

      c:>java SampleFrame
      Message:
      A nonfatal internal JIT(3.00.078(x)) error 'structured exception(c0000090)' has
      occured
      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

      source code for SampleFrame.java in Comments.
      _________________________________________


      Error Details:

      JAVA caused an exception 10H in module JVM.DLL at 0157:5046c826.
      Registers:
      EAX=00000095 CS=0157 EIP=5046c826 EFLGS=00210216
      EBX=00000001 SS=015f ESP=056cf318 EBP=0517fe88
      ECX=00000001 DS=015f ESI=0070e466 FS=5b87
      EDX=0517fe90 ES=015f EDI=0517fec0 GS=0000
      Bytes at CS:EIP:
      d8 5f fc 83 ef 08 83 c0 02 eb 15 89 1f 83 c7 04
      Stack dump:
      056cf358 056c0000 007013c4 00835540 0070d670 0517fd34 1f701370 50395384 00701560
      00835540 056cf390 056cf7b8 056cf390 056cf3b8 503e8596 056cf301
      (Review ID: 98992)
      ======================================================================

      Name: skT88420 Date: 01/17/2000


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




      g.drawString("Sample Shapes", 100, 200);
      g.drawchars(...);

      - works fine when i use drawRect kinda function

      - this was the last thing caught when program crashed

      - A nonfatal internal JIT (3.00.078(X)) error 'Structured Exception (c0000090)'
      has occured 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
      (Review ID: 100045)
      ======================================================================

      Name: skT88420 Date: 02/09/2000


      java version "1.2.1"
      Classic VM(build JDK-1.2.1-A,native threads

        Program that caused this was the PrintExample at Marty Hall's site:

      http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/

      first trouble I've had so far that does not appear to be of my making !

      A nonfatal Internal JIT (3.00.078(x)) error 'Structured Exception (c0000090)'
      has occured in:

      'java/awt/font/TextLine.getBounds()
      Ljava/awt/geom/Rectangle2D;'
      Interpreting method.

      Using the JDK 1.2.1 on a
      166 Intel Pentium PC with 32MB RAM connected to Plustek Scanner connected to
      Epson Stylus 200 Printer.
      (Review ID: 101032)
      ======================================================================


      Name: skT88420 Date: 06/10/99


      I've been trying the ShapesPrint and SimpleBook example to print
      and The following error occurs when trying to print:

      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
      (Review ID: 84191)
      ======================================================================

      Name: skT88420 Date: 06/10/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.
      Please report this error in detail to...
      (Review ID: 83272)
      ======================================================================

      Name: krT82822 Date: 06/22/99


      A nonfatal internal JIT (3.00.078(x)) error 'Structured Exception(c0000090)' has occured in : 'java/awt/font/TextLine.getBounds ()Ljava/awt/geom/Rectangle2D;': Interpreting method.
      Please report this error in detail to ... - i'm allready on it.. :-)

      Windows-Statement:
      Diese Anwendung verursachte einen Ausnahmefehler.
      This application caused an Exception-Error.

      Used Printers: HP-LJ 5P and Cannon BJC 2000

      SourceCode:

      class PrintReader implements Pageable, Printable
      {
      PrintReader()
      {
      }

      public int getNumberOfPages()
      {
      return 1;
      }

      public PageFormat getPageFormat(int pageIndex) throws IndexOutOfBoundsException
      {
      return new PageFormat();
      }

      public Printable getPrintable(int pageIndex) throws IndexOutOfBoundsException
      {
      return (this);
      }

      public int print(Graphics g, PageFormat argPageFormat, int argPageIndex) throws PrinterException
      {
      g.drawString("Hello World",10,10);
      return Printable.PAGE_EXISTS;
      }
      }

      I just wanted to create a 'PrinterReader'. A class that simply parse and print a BufferdReader. That's all.

      Version:
      java version "1.2"
      Classic VM (build JDK-1.2-V, native threads)

      JAVA.EXE full version "JDK-1.2-V"
      (Review ID: 84646)
      ======================================================================

      Name: krT82822 Date: 07/01/99


      Message:
      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.

      Details:
      JAVA verursachte einen Ausnahmefehler 10H in Modul JVM.DLL bei 014f:5046c826.
      Register:
      EAX=00000095 CS=014f EIP=5046c826 EFLGS=00010212
      EBX=00000001 SS=0157 ESP=0063e590 EBP=00650938
      ECX=00000001 DS=0157 ESI=007078e6 FS=3cff
      EDX=00650940 ES=0157 EDI=00650970 GS=0000
      Bytes bei CS:EIP:
      d8 5f fc 83 ef 08 83 c0 02 eb 15 89 1f 83 c7 04
      Stapelwerte:
      0063e5d0 00630000 00695830 00760980 00706af0 00650814 1f701370 50395384 00696658 00760980 0063e610 0063ea40 0063e610 0063e640 503e8596 0063e501

      My Test-Programm: (tested with JDK 1.2 and JDK 1.2.1)

      import java.awt.*;
      import java.awt.print.*;
      import java.awt.event.*;
      import javax.swing.*;
      import javax.swing.event.*;
      //
      //
      // Println
      //
      //
      // mein Farbdrucker wollte nur Rechtecke, Kreise, ... aber kein String drucken
      // mein Nadeldrucker druckte den Text ohne Probleme

      class Println extends JTextArea implements Printable //=Schnittstelle zum drucken
      //print-Routine mu? ?berschrieben werden
      {
      public String druckeText = ""; //Text der gedruckt werden soll

      public Println() //Konstruktor
      {
      super();
      setText(druckeText);
      }


      //Print-Routine mu? ?berschrieben werden(in Printable vorgegeben)
      //
      public int print(Graphics g, PageFormat pf, int pi) throws PrinterException
      {
      if(pi >= 1) return Printable.NO_SUCH_PAGE;

      Graphics2D g2 = (Graphics2D)g;

      g2.translate(pf.getImageableX(), pf.getImageableY()); //Startpunkt im Graphickontext verschieben(Nullpunkt) | Rand bla bla bla...
              
      //g2.setFont(new Font("Arial", Font.BOLD, 12));
      //g2.setColor(Color.red);
      //g2.drawRect(10,10,100,100);
      //g2.drawArc(10,10,100,100,0,360);
      //g2.drawString(druckeText, 10, 10); //funktioniert auch, bis auf
      //der Zeilenvorschub beim drucken
      //deswegen umweg ?ber JTextArea

      setFont(new Font("Arial", Font.BOLD, 12)); //Schriftsatz festlegen f?r TextArea
      setForeground(Color.red); //Schriftfarbe f?r TextArea

      paintAll(g2); //Textarea drucken //nur paint(g2) funktionierte nicht

      g2.dispose(); //Grafikcontext l?schen

      return Printable.PAGE_EXISTS;
      }

      public void drucke(String text)
      {
      druckeText = new String(text); //Text setzen
      setText(druckeText); //Text ins TextArea setzen

      PrinterJob myPrintJob = PrinterJob.getPrinterJob(); //PrinterJob anlegen
      myPrintJob.setPrintable(this); //diese Klasse als druckbar setzen

      if( myPrintJob.printDialog() ) //Printdialog ?ffnen
      {
      try
      {
      myPrintJob.print(); //drucken-ruft die print-Routine auf <siehe oben>
      }
      catch(Exception e){}
      }

      }

      public static void main(String[] args)
      {
      Println me = new Println(); //eine Instanz meiner Printklasse

      JFrame f = new JFrame("F"); //Fenster

      f.addWindowListener(new WindowAdapter()
      {
      public void windowClosing(WindowEvent e){System.exit(0);}
      });
      f.getContentPane().add(new JScrollPane(me)); //f?ge JTextfeld ins Fenster ein
      f.setSize(100,100); //Fenstergroesse
      f.show(); //Anzeigen

      //verwende eine JScrollpane um alle Zeilen, auch die welche nicht
      //sichtbar sind, zu drucken

      //hier schreibe ich den Text der gedruckt werden soll (13 Zeilen Hallo Heinz)
      me.drucke("Test-Druck?);
      }


      }
      (Review ID: 85077)
      ======================================================================

      Name: skT88420 Date: 07/06/99


      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

      Received the erro while attempting to print a JTable on HP 5000N PCL 6 printer
      Was able to print before now.
      (Review ID: 85248)
      ======================================================================

      Name: skT88420 Date: 07/07/99


      Trying to run your example Report.java from writing advanced applications chapter 6.
      Generates the following error:
      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


      java -version =
      java version "1.2"
      Classic VM (build JDK-1.2-V, native threads)

      java -fullversion =
      JAVA.EXE full version "JDK-1.2-V"

      I am just trying to teach myself Java to see if we should use it for our internal development.
      I have been unsuccessful in using any of the example printing methods for report-type output.
      It is quite possible that this is related to my setup, but I have no idea what it might be.
      Any feedback would be appreciated.

      source code follows:

      import javax.swing.*;
      import javax.swing.table.*;
      import java.awt.print.*;
      import java.util.*;
      import java.awt.*;
      import java.awt.event.*;
      import java.awt.geom.*;
      import java.awt.Dimension;

      public class Report implements Printable
      {
      JFrame frame;
      JTable tableView;

      public Report()
      {
      frame = new JFrame("Sales Report");

      frame.addWindowListener(new WindowAdapter()
      { public void windowClosing(WindowEvent e) {System.exit(0);}});

       
      final String[] headers = {"Description", "open price","latest price", "End Date", "Quantity"};
       
      final Object[][] data =
      {
      {"Box of Biros", "1.00", "4.99", new Date(), new Integer(2)},
      {"Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
      {"legal pad", "1.00", "2.49", new Date(), new Integer(1)},
      {"tape", "1.00", "1.49", new Date(), new Integer(1)},
      {"stapler", "4.00", "4.49", new Date(), new Integer(1)},
      {"legal pad", "1.00", "2.29", new Date(), new Integer(5)}
      };

       
      TableModel dataModel = new AbstractTableModel()
      {
      public int getColumnCount() { return headers.length; }
      public int getRowCount() { return data.length;}
      public Object getValueAt(int row, int col) { return data[row][col];}
      public String getColumnName(int column) { return headers[column];}
      public Class getColumnClass(int col) { return getValueAt(0,col).getClass();}
      public boolean isCellEditable(int row, int col) { return (col==1);}
      public void setValueAt(Object aValue, int row, int column) { data[row][column] = aValue; }
      };

      tableView = new JTable(dataModel);
      JScrollPane scrollpane = new JScrollPane(tableView);

      scrollpane.setPreferredSize(new Dimension(500, 80));
      frame.getContentPane().setLayout(new BorderLayout());
      frame.getContentPane().add(BorderLayout.CENTER,scrollpane);
      frame.pack();
      JButton printButton= new JButton();

      printButton.setText("print me!");
      frame.getContentPane().add(BorderLayout.SOUTH,printButton);

      // for faster printing turn double buffering off
      RepaintManager.currentManager(frame).setDoubleBufferingEnabled(false);

      printButton.addActionListener( new ActionListener(){
          public void actionPerformed(ActionEvent evt) {
      PrinterJob pj=PrinterJob.getPrinterJob();
      pj.setPrintable(Report.this);
      pj.printDialog();
      try
      {
      pj.print();
      }
      catch (Exception PrintException) {}
      }});

      frame.setVisible(true);
      }

      public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException
      {
      Graphics2D g2 = (Graphics2D) g;
      g2.setColor(Color.black);
      int fontHeight=g2.getFontMetrics().getHeight();
      int fontDesent=g2.getFontMetrics().getDescent();
       
      //leave room for page number
      double pageHeight = pageFormat.getImageableHeight()-fontHeight;
      double pageWidth = pageFormat.getImageableWidth();
      double tableWidth = (double)
      tableView.getColumnModel().getTotalColumnWidth();
      double scale = 1;
      if (tableWidth >= pageWidth)
      {
      scale = pageWidth / tableWidth;
      }

      double headerHeightOnPage=
      tableView.getTableHeader().getHeight()*scale;
      double tableWidthOnPage=tableWidth*scale;

      double oneRowHeight = (tableView.getRowHeight()+tableView.getRowMargin())*scale;
      int numRowsOnAPage = (int)((pageHeight-headerHeightOnPage)/oneRowHeight);
      double pageHeightForTable=oneRowHeight*numRowsOnAPage;
      int totalNumPages= (int)Math.ceil(((double)tableView.getRowCount())/numRowsOnAPage);
      if(pageIndex>=totalNumPages)
      {
      return NO_SUCH_PAGE;
      }

      g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
      //bottom center
      g2.drawString("Page: "+(pageIndex+1),(int)pageWidth/2-35,(int)(pageHeight+fontHeight-fontDesent));


      g2.translate(0f,headerHeightOnPage);
      g2.translate(0f,-pageIndex*pageHeightForTable);

      //If this piece of the table is smaller than the size available,
      //clip to the appropriate bounds.
      if (pageIndex + 1 == totalNumPages)
      {
      int lastRowPrinted = numRowsOnAPage * pageIndex;
      int numRowsLeft = tableView.getRowCount() - lastRowPrinted;
      g2.setClip(0, (int)(pageHeightForTable * pageIndex),(int) Math.ceil(tableWidthOnPage),
      (int) Math.ceil(oneRowHeight * numRowsLeft));
      }
      //else clip to the entire area available.
      else
      {
      g2.setClip(0, (int)(pageHeightForTable*pageIndex), (int) Math.ceil(tableWidthOnPage),
      (int) Math.ceil(pageHeightForTable));
      }

      g2.scale(scale,scale);
      tableView.paint(g2);
      g2.scale(1/scale,1/scale);
      g2.translate(0f,pageIndex*pageHeightForTable);
      g2.translate(0f, -headerHeightOnPage);
      g2.setClip(0, 0,(int) Math.ceil(tableWidthOnPage), (int)Math.ceil(headerHeightOnPage));
      g2.scale(scale,scale);
      tableView.getTableHeader().paint(g2);//paint header at top

      return Printable.PAGE_EXISTS;
      }

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

      }
      (Review ID: 85309)
      ======================================================================

      Name: skT88420 Date: 07/09/99


      A nonFatal error internal JIT (3.00.078(x)) error 'structured
      Exception(c0000090)' has occured in
        java/awt/font/TextLine.getBounds()L java/awt/geom/Rectangle2D;
       Interpreting method
      (Review ID: 85432)
      ======================================================================

      Name: skT88420 Date: 07/22/99


      Steps:
      //the code that calls the printing class:
            if (job.printDialog()) {
              // Print the job if the user didn't cancel printing
              try { job.print(); }
              catch (Exception e) { System.err.println(">" + e + "<"); }
            }
      //the code of the printing class
        public int print(Graphics g, PageFormat pf, int pageIndex)
              throws PrinterException {
          if (pageIndex >= 1) return Printable.NO_SUCH_PAGE;
            //no colors, b/w printing ??
            pf.setOrientation( pf.LANDSCAPE );
            g.setColor(Color.black);
              
            g.setFont(titleFnt);
          g.drawString(title, 300, 80 );
            g.setFont(fnt);

            for(int i=0; i<Titles.length ; i++) {
           g.drawString(Titles[i], 80 + (110*i), 120 );
            }
            
            for(int i=0; i<Data.length ; i++) {
             for(int j=0; j<nColumns ; j++) {
               g.drawString(Data[i][j], 80 + (110*j), 140 + (20*i) );
          }
            }

          //g.drawString("Page " + (pageIndex+1), 100, 1000);
          return Printable.PAGE_EXISTS;
        }
      //end of the code

      launch Ania.class
      java it....Ania

      Do a query and get a JTable.
      Print the data of the JTable, not the JTable it self.
      I was using a Lexmark both locally and through the web
      (two different Lexmark printers).
      The print dialog comes out, select OK,
      the program crashes before it is able to print.

      Launching the applet version under IE4.0 with Java Plug-in
      1.2.1, Internet Explorer crashes.


      Output:

      nonfatal internal JIT (3.00.078(x)) error
      'Structured Exception (c000090) has occured in
      'java/awt/font/TextLine.getBounds() Ljava/awt/geom/Rectangle2D;':
      interpreting method

      Thanks.

      Marco Bonechi
      (Review ID: 88261)
      ======================================================================

      Name: skT88420 Date: 09/15/99


      The SimpleBook example from the Java Tutorial crashes the JVM.

      The following error messages are displayed:

      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


      JAVA caused an exception 10H in module JVM.DLL at 014f:50468b5e.
      Registers:
      EAX=00000095 CS=014f EIP=50468b5e EFLGS=00010206
      EBX=00000001 SS=0157 ESP=056ae840 EBP=0514047c
      ECX=00000001 DS=0157 ESI=0070ae3a FS=4bef
      EDX=05140484 ES=0157 EDI=051404b4 GS=0000
      Bytes at CS:EIP:
      d8 5f fc 83 ef 08 83 c0 02 eb 15 89 1f 83 c7 04
      Stack dump:
      056ae880 056a0000 052df274 0083aa00 0070a044 05140358 1f701370 50395384 052df2e8 0083aa00 056ae8b8 056aece0 056ae8b8 056ae8e0 503e8596 056ae801

      import java.awt.event.*;
      import javax.swing.*;
      import java.awt.eve

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                skonchad Sandeep Konchady
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: