-
Bug
-
Resolution: Fixed
-
P4
-
1.0, 1.3.0, 1.3.1, 1.4.0
-
mantis
-
x86
-
windows_95, windows_98, windows_2000
reason and solutions.
Current Java thread:
Dynamic libraries:
0x76AC0000 - 0x76ADD000 C:\WINDOWS\SYSTEM\IMAGEHLP.DLL
Local Time = Tue Aug 28 16:17:26 2001
Elapsed Time = 15
#
# HotSpot Virtual Machine Error : EXCEPTION_FLT_INVALID_OPERATION
# Error ID : 4F530E43505002CC
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.3.1-b24 mixed mode)
#
# An error report file has been saved as hs_err_pid4291124921.log.
# Please refer to the file for further information.
#
(Review ID: 130808)
======================================================================
Name: rmT116609 Date: 10/21/2001
Java VM: Java HotSpot(TM) Client VM (1.4.0-beta2-b77 interpreted mode)
Printing with HP 1220C printer......get faliure with 1.3.1 and 1.4.0-beta2
Unexpected Signal : EXCEPTION_FLT_INVALID_OPERATION occurred at PC=0xBA9E24
Function=[Unknown.]
Library=(N/A)
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.
Current Java thread:
Dynamic libraries:
0x7CC00000 - 0x7CC1D000 C:\WINDOWS\SYSTEM\IMAGEHLP.DLL
Local Time = Sun Oct 21 12:47:53 2001
Elapsed Time = 190
#
# HotSpot Virtual Machine Error : EXCEPTION_FLT_INVALID_OPERATION
# Error ID : 4F530E43505002D7
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.4.0-beta2-b77 interpreted mode)
#
(Review ID: 134167)
======================================================================
Name: stC104175 Date: 07/10/2000
SUN Java 2 SDK v1.3.0
HOTSPOT VM ERROR, EXCEPTION_FLT_INVALID_OPERATION
ERROR ID: 4F533F57494E13120E4350500204
ABNORMAL PROGRAM TERMINATION
starting SUN's Java Tutorial "ShapesPrint.class/java" within my own
application from button action:
.. PrintButtonActionPerformed(..)
{
ShapesPrint myPrint = ShapesPrint();
myPrint.Run(); //->> main() renamed tor un() in ShapesPrint.java (runnable)
}
(1) "ShapesPrint" Frame appears
(2) Pressing "Print" Button on ShapesPrint - Frame "Spacebar" keyboard button
(3) -> report error form on Systemout window
(Review ID: 107024)
======================================================================
Name: yyT116575 Date: 12/06/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
The code is supposed to print a file. It had worked fine on Windows 98 a few
times, but doesn't work anymore. I tried on Windows 95, and got the same error.
Both have the same jdk1.3 version.
The program is basically the same as the print example in
http://java.sun.com/products//jdk/1.2/docs/guide/2d/spec/j2d-print.fm3.html. It
crashes at the first drawString call.
Source Code
------------
import java.awt.*;
import java.awt.print.*;
import java.io.*;
public class PrintListing2 {
public static void main(String[] args) {
PrinterJob job = PrinterJob.getPrinterJob();
PageFormat pf = job.pageDialog(job.defaultPage());
job.setPrintable(new PrintListingPainter(args[0]), pf);
job.setCopies(1);
if (job.printDialog()) {
try { job.print(); }
catch (PrinterException e)
{ System.out.println(e); }
}
System.exit(0);
}
}
class PrintListingPainter implements Printable {
private RandomAccessFile raf;
private String fileName;
private Font fnt = new Font("Helvetica", Font.PLAIN, 10);
private int rememberedPageIndex = -1;
private long rememberedFilePointer = -1;
private boolean rememberedEOF = false;
public PrintListingPainter(String file) {
fileName = file;
try { raf = new RandomAccessFile(file, "r");}
catch (IOException e) {rememberedEOF = true; }
}
public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException {
try {
if (pageIndex != rememberedPageIndex) {
rememberedPageIndex = pageIndex;
if (rememberedEOF) return Printable.NO_SUCH_PAGE;
rememberedFilePointer = raf.getFilePointer();
}
else
raf.seek(rememberedFilePointer);
g.setColor(Color.black);
g.setFont(fnt);
int x = (int) pf.getImageableX();
int y = (int) pf.getImageableY();
x += 10;
y += 12;
System.out.println("x = " + x);
System.out.println("y = " + y);
// Title line
g.drawString("File: " + fileName + ", page: " + (pageIndex+1), x, y);
// Generate as many lines as will fit in imageable area
y += 36;
while (y + 12 < pf.getImageableY() +pf.getImageableHeight()) {
String line = raf.readLine();
if (line == null) {
rememberedEOF = true;
break;
}
g.drawString(line, x, y);
y += 12;
}
return Printable.PAGE_EXISTS;
} catch (Exception e) { return Printable.NO_SUCH_PAGE;}
}
}
The error is:
HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
Please report this error at...
Error ID: 4F533F57494E13120E43505002D4
abnormal program termination
(Review ID: 112463)
======================================================================
Name: yyT116575 Date: 12/11/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) ClientVM (build 1.3.0-C, mixed mode)
Every time i print a pageable, printable Canvas on a Postscript-Printer
like our "Tektronix Phaser 740" my application is ending by an error:
This is the output on my MS-DOS-Console:
#
# HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
# Please reportthis error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4F533F57494E1312E43505002D4
#
abnormal program termination
I tried to mange this via PostScript-Format: I have tried:
- PostScipt ADSC
- PostScript optimal
- PostScript EPS
Everything with the same result.
Here the code:
============================================================================
import java.awt.*;
import java.awt.event.*;
import java.awt.print.*;
import javax.swing.*;
class TestClosing extends WindowAdapter {
public void windowClosing(WindowEvent e) {System.exit(0);}
}
class Test extends JFrame implements ActionListener {
public static void main(String args[]) {new Test();}
private PrintingTest pt;
public Test() {
super();
// Create my pageable & printable Canvas
pt = new PrintingTest();
// Test-Button
JButton testbtn = new JButton("TEST");
testbtn.addActionListener(this);
getContentPane().add(testbtn, BorderLayout.NORTH);
// other stuff ...
addWindowListener(new TestClosing());
this.setLocation(300,300);
pack();
show();
}
public void actionPerformed(ActionEvent ae) {
if (ae.getActionCommand().equals("TEST")) pt.print();
}
}
class PrintingTest extends Canvas implements Pageable, Printable {
PrinterJob pJob;
PageFormat pFormat;
Paper paper;
public PrintingTest() {
pJob = PrinterJob.getPrinterJob();
pJob.setPrintable(this);
pJob.setPageable(this);
pJob.setJobName("Java-Printer-Job");
pFormat = pJob.defaultPage();
paper = pFormat.getPaper();
pFormat.setPaper(paper);
}
public void print() {
if (pJob.printDialog()) {
try {
pJob.print();
} catch(Exception e) {
System.out.println(e.getMessage());
}
}
}
public int getNumberOfPages() {return 1;}
public PageFormat getPageFormat(int pageIndex) {return pFormat;}
public Printable getPrintable(int pageIndex) {return this;}
public int print(Graphics g, PageFormat pf, int pageIndex) {
if (pageIndex < 1) {
g.setColor(Color.black);
// Border
g.drawRect( (int)pFormat.getImageableX()+50,
(int)pFormat.getImageableY()+50,
(int)pFormat.getImageableWidth()-100,
(int)pFormat.getImageableHeight()-100
);
// Page-String
g.drawString( "Page "+(pageIndex+1)+" of 1",
(int)pFormat.getImageableX()+(int)pFormat.getImageableWidth()-125,
(int)pFormat.getImageableY()+(int)pFormat.getImageableHeight()-75
);
// Translation
g.translate((int)(pFormat.getImageableX()+50),(int)(pFormat.getImageableY()+50))
;
g.dispose();
return PAGE_EXISTS;
} else return NO_SUCH_PAGE;
}
}
(Review ID: 113610)
======================================================================
Name: rmT116609 Date: 12/15/2000
java version "1.3.0"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.3.0-c)
Java HotSpot(TM) Client VM (build 1.3.0-c, mixed mode)
Not sure of the steps on this one. I was printing to a Graphics object obtained
through a call to PrinterJob.getPrinterJob() as below:
PrinterJob pj = PrinterJob.getPrinterJob();
PageFormat pf = pj.pageDialog(pj.defaultPage());
if (pj.printDialog()) {
pj.setPrintable(report);
pj.print();
}
The print method for the report reference above is:
public int print(Graphics c, PageFormat pf, int index) {
/*
* This printable will always print only one page, so
* if this is not page 0, return NO_SUCH_PAGE
*/
if (index > 0) {
return NO_SUCH_PAGE;
}
else {
try {
/*
* Read a series of JLabels from our Panel and print to the printer
*/
int leftMargin = (new Double(pf.getImageableX() * 72)).intValue();
int topMargin = (new Double(pf.getImageableY() * 72)).intValue();
for (int i = 0; i < panel.getComponentCount(); i++) {
(JLabel) label = (JLabel) panel.getComponent(i);
g.setFont(label.getFont());
g.drawString(label.getText(), label.getLocation().x + leftMargin,
label.getLocation().y + topMargin + label.getFont().getSize());
}
return PAGE_EXISTS;
}
catch(Exception ex) {
ex.printStackTrace();
return NO_SUCH_PAGE;
}
}
}
After running the program the following error was reported:
#
# HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4F533F57494E13120E43505002D4
#
(Review ID: 113872)
======================================================================
Name: yyT116575 Date: 01/03/2001
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
After the user pressed 'ok' on the PrintDialog that my program offers him, the
following console message is displayed and the program exits.
#
# HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4F533F57494E13120E43505002D4
#
abnormal program termination
The program code is as follows:
import java.awt.*;
import java.awt.print.*;
import java.awt.event.*;
public class PrinterPanel extends Panel implements ActionListener, Printable
{
CPanel cPanel; //panel to be printed
Button bPrint;
Button bCancelPrint;
Button bPageSetup;
PrinterJob printerJob;
PageFormat pageFormat;
Label message;
//static boolean printMode=false;
PrinterPanel(CPanel cPanel)
{
this.cPanel = cPanel;
bPrint = new Button("Print");
bCancelPrint = new Button("Cancel Printing");
bPageSetup = new Button("Page Setup");
message = new Label("Please wait ...");
printerJob = PrinterJob.getPrinterJob();
bPrint.addActionListener(this);
bCancelPrint.addActionListener(this);
bPageSetup.addActionListener(this);
setLayout(new FlowLayout(FlowLayout.LEFT));
setBackground(new Color(22,44,22));
add(bPrint);
add(bCancelPrint);
add(bPageSetup);
add(message);
message.setVisible(false);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource() == bPrint)
{
printerJob.setPrintable(this);
if(printerJob.printDialog())
{
try
{
printerJob.print();
}
catch(PrinterException pe)
{
System.out.println(pe.getMessage());
}
}
}
else if(ae.getSource() == bCancelPrint)
{
if(!printerJob.isCancelled())
{
System.out.println("Cancelling print job.");
printerJob.cancel();
}
}
else
{
pageFormat = printerJob.pageDialog
(printerJob.defaultPage());
printerJob.setPrintable(this, pageFormat);
}
}
public int print(Graphics g, PageFormat pf, int pgIndex)
{
//g = g.create((int)pf.getImageableX(), (int)pf.getImageableY
(), (int)pf.getImageableWidth(), (int)pf.getImageableHeight());
if(pgIndex > 0)
return Printable.NO_SUCH_PAGE;
//printMode=true;
printChart(g, pf);
/*switch(wa.mode)
{
case 0:
wa.drawPie(g);
break;
case 1:
wa.drawBar(g);
break;
case 2:
wa.drawLG(g);
break;
}*/
return Printable.PAGE_EXISTS;
}
public void printChart(Graphics g, PageFormat pf) //function to
position various panels and print them
{
int originX = (int)pf.getImageableX();
int originY = (int)pf.getImageableY();
int imageableWidth = (int)pf.getImageableWidth();
int imageableHeight = (int)pf.getImageableHeight();
/*System.out.println(selectedFile);
System.out.println(cPanel.titlePanel.disp.title);
cPanel.titlePanel.disp.title += selectedFile;
System.out.println(cPanel.titlePanel.disp.title);*/
Graphics g1 = g.create(originX, originY,
cPanel.disp.w1+cPanel.disp.w2, cPanel.disp.h1);
cPanel.titlePanel.draw(g1);
Graphics g2 = g.create(originX, originY+cPanel.disp.h1,
cPanel.disp.w1, cPanel.disp.h1);
cPanel.stubPanel.draw(g2);
Graphics g3 = g.create(originX+cPanel.disp.w1,
originY+cPanel.disp.h1, cPanel.disp.w1+cPanel.disp.w2,
cPanel.disp.h1+cPanel.disp.h1);
cPanel.rulerCanvas.draw(g3);
Graphics g4 = g.create(originX,
originY+cPanel.disp.h1+cPanel.disp.h1, cPanel.disp.w1,
cPanel.disp.h1+cPanel.disp.h1+cPanel.disp.h2);
cPanel.machCanvas.draw(g4);
Graphics g5 = g.create(originX+cPanel.disp.w1,
originY+cPanel.disp.h1+cPanel.disp.h1, cPanel.disp.w1+cPanel.disp.w2,
cPanel.disp.h1+cPanel.disp.h1+cPanel.disp.h2);
cPanel.chartCanvas.displayChart(g5);
Graphics g6 = g.create(originX,
originY+cPanel.disp.h1+cPanel.disp.h1+cPanel.disp.h2,
cPanel.disp.w1+cPanel.disp.w2,
cPanel.disp.h1+cPanel.disp.h1+cPanel.disp.h2+cPanel.disp.h1);
cPanel.messagePanel.draw(g6);
}
}
(Review ID: 114532)
======================================================================
Name: krC82822 Date: 02/18/2001
java version 1.3.0
Java (TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot (TM) Client VM (build 1.3.0-C, mixed mode)
This code works fine:
if (pj.printDialog()){
try{
pj.print();
}
catch (PrinterException pe){
System.out.println("Exception while printing.\n");
pe.printStackTrace();
}
}
This code results in an error and abnormal termination of program:
try{
pj.print();
}
catch (PrinterException pe){
System.out.println("Exception while printing.\n");
pe.printStackTrace();
}
The exact error statement reads:
#HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
#Please report this error at
#http://java.sun.com/cgi-bin/bugreport.cgi
#
#Error ID: 4F533F57494E13120E43505002D4
Please note the following:
(1) I am using the Windows Me operating system.
(2) I am a novice developer. However, the only difference between
the working code and the code that results in the error is that
the working code is blocked within an IF statement that calls
the printer dialog.
(Review ID: 117193)
======================================================================
Name: yyT116575 Date: 02/26/2001
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
i want to make a program to print the image . when i cliked on ok to
PrintDialog it wil give error like as under..........
#
# HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4F533F57494E13120E43505002D4
#
abnormal program termination
(Review ID: 117628)
======================================================================
Name: krC82822 Date: 08/28/2001
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
D:\tutorial\2d\printing\example-1dot2>java ShapesPrint
Unexpected Signal : EXCEPTION_FLT_INVALID_OPERATION occurred at PC=0x66c8ea
Function name=(N/A)
Library=(N/A)
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
Current Java thread:
Dynamic libraries:
0x76AC0000 - 0x76ADD000 C:\WINDOWS\SYSTEM\IMAGEHLP.DLL
Local Time = Tue Aug 28 16:17:26 2001
Elapsed Time = 15
#
# HotSpot Virtual Machine Error : EXCEPTION_FLT_INVALID_OPERATION
# Error ID : 4F530E43505002CC
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.3.1-b24 mixed mode)
#
# An error report file has been saved as hs_err_pid4291124921.log.
# Please refer to the file for further information.
#
(Review ID: 130808)
======================================================================
Name: rmT116609 Date: 10/21/2001
Java VM: Java HotSpot(TM) Client VM (1.4.0-beta2-b77 interpreted mode)
Printing with HP 1220C printer......get faliure with 1.3.1 and 1.4.0-beta2
Unexpected Signal : EXCEPTION_FLT_INVALID_OPERATION occurred at PC=0xBA9E24
Function=[Unknown.]
Library=(N/A)
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.
Current Java thread:
Dynamic libraries:
0x7CC00000 - 0x7CC1D000 C:\WINDOWS\SYSTEM\IMAGEHLP.DLL
Local Time = Sun Oct 21 12:47:53 2001
Elapsed Time = 190
#
# HotSpot Virtual Machine Error : EXCEPTION_FLT_INVALID_OPERATION
# Error ID : 4F530E43505002D7
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.4.0-beta2-b77 interpreted mode)
#
(Review ID: 134167)
======================================================================
Name: stC104175 Date: 07/10/2000
SUN Java 2 SDK v1.3.0
HOTSPOT VM ERROR, EXCEPTION_FLT_INVALID_OPERATION
ERROR ID: 4F533F57494E13120E4350500204
ABNORMAL PROGRAM TERMINATION
starting SUN's Java Tutorial "ShapesPrint.class/java" within my own
application from button action:
.. PrintButtonActionPerformed(..)
{
ShapesPrint myPrint = ShapesPrint();
myPrint.Run(); //->> main() renamed tor un() in ShapesPrint.java (runnable)
}
(1) "ShapesPrint" Frame appears
(2) Pressing "Print" Button on ShapesPrint - Frame "Spacebar" keyboard button
(3) -> report error form on Systemout window
(Review ID: 107024)
======================================================================
Name: yyT116575 Date: 12/06/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
The code is supposed to print a file. It had worked fine on Windows 98 a few
times, but doesn't work anymore. I tried on Windows 95, and got the same error.
Both have the same jdk1.3 version.
The program is basically the same as the print example in
http://java.sun.com/products//jdk/1.2/docs/guide/2d/spec/j2d-print.fm3.html. It
crashes at the first drawString call.
Source Code
------------
import java.awt.*;
import java.awt.print.*;
import java.io.*;
public class PrintListing2 {
public static void main(String[] args) {
PrinterJob job = PrinterJob.getPrinterJob();
PageFormat pf = job.pageDialog(job.defaultPage());
job.setPrintable(new PrintListingPainter(args[0]), pf);
job.setCopies(1);
if (job.printDialog()) {
try { job.print(); }
catch (PrinterException e)
{ System.out.println(e); }
}
System.exit(0);
}
}
class PrintListingPainter implements Printable {
private RandomAccessFile raf;
private String fileName;
private Font fnt = new Font("Helvetica", Font.PLAIN, 10);
private int rememberedPageIndex = -1;
private long rememberedFilePointer = -1;
private boolean rememberedEOF = false;
public PrintListingPainter(String file) {
fileName = file;
try { raf = new RandomAccessFile(file, "r");}
catch (IOException e) {rememberedEOF = true; }
}
public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException {
try {
if (pageIndex != rememberedPageIndex) {
rememberedPageIndex = pageIndex;
if (rememberedEOF) return Printable.NO_SUCH_PAGE;
rememberedFilePointer = raf.getFilePointer();
}
else
raf.seek(rememberedFilePointer);
g.setColor(Color.black);
g.setFont(fnt);
int x = (int) pf.getImageableX();
int y = (int) pf.getImageableY();
x += 10;
y += 12;
System.out.println("x = " + x);
System.out.println("y = " + y);
// Title line
g.drawString("File: " + fileName + ", page: " + (pageIndex+1), x, y);
// Generate as many lines as will fit in imageable area
y += 36;
while (y + 12 < pf.getImageableY() +pf.getImageableHeight()) {
String line = raf.readLine();
if (line == null) {
rememberedEOF = true;
break;
}
g.drawString(line, x, y);
y += 12;
}
return Printable.PAGE_EXISTS;
} catch (Exception e) { return Printable.NO_SUCH_PAGE;}
}
}
The error is:
HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
Please report this error at...
Error ID: 4F533F57494E13120E43505002D4
abnormal program termination
(Review ID: 112463)
======================================================================
Name: yyT116575 Date: 12/11/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) ClientVM (build 1.3.0-C, mixed mode)
Every time i print a pageable, printable Canvas on a Postscript-Printer
like our "Tektronix Phaser 740" my application is ending by an error:
This is the output on my MS-DOS-Console:
#
# HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
# Please reportthis error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4F533F57494E1312E43505002D4
#
abnormal program termination
I tried to mange this via PostScript-Format: I have tried:
- PostScipt ADSC
- PostScript optimal
- PostScript EPS
Everything with the same result.
Here the code:
============================================================================
import java.awt.*;
import java.awt.event.*;
import java.awt.print.*;
import javax.swing.*;
class TestClosing extends WindowAdapter {
public void windowClosing(WindowEvent e) {System.exit(0);}
}
class Test extends JFrame implements ActionListener {
public static void main(String args[]) {new Test();}
private PrintingTest pt;
public Test() {
super();
// Create my pageable & printable Canvas
pt = new PrintingTest();
// Test-Button
JButton testbtn = new JButton("TEST");
testbtn.addActionListener(this);
getContentPane().add(testbtn, BorderLayout.NORTH);
// other stuff ...
addWindowListener(new TestClosing());
this.setLocation(300,300);
pack();
show();
}
public void actionPerformed(ActionEvent ae) {
if (ae.getActionCommand().equals("TEST")) pt.print();
}
}
class PrintingTest extends Canvas implements Pageable, Printable {
PrinterJob pJob;
PageFormat pFormat;
Paper paper;
public PrintingTest() {
pJob = PrinterJob.getPrinterJob();
pJob.setPrintable(this);
pJob.setPageable(this);
pJob.setJobName("Java-Printer-Job");
pFormat = pJob.defaultPage();
paper = pFormat.getPaper();
pFormat.setPaper(paper);
}
public void print() {
if (pJob.printDialog()) {
try {
pJob.print();
} catch(Exception e) {
System.out.println(e.getMessage());
}
}
}
public int getNumberOfPages() {return 1;}
public PageFormat getPageFormat(int pageIndex) {return pFormat;}
public Printable getPrintable(int pageIndex) {return this;}
public int print(Graphics g, PageFormat pf, int pageIndex) {
if (pageIndex < 1) {
g.setColor(Color.black);
// Border
g.drawRect( (int)pFormat.getImageableX()+50,
(int)pFormat.getImageableY()+50,
(int)pFormat.getImageableWidth()-100,
(int)pFormat.getImageableHeight()-100
);
// Page-String
g.drawString( "Page "+(pageIndex+1)+" of 1",
(int)pFormat.getImageableX()+(int)pFormat.getImageableWidth()-125,
(int)pFormat.getImageableY()+(int)pFormat.getImageableHeight()-75
);
// Translation
g.translate((int)(pFormat.getImageableX()+50),(int)(pFormat.getImageableY()+50))
;
g.dispose();
return PAGE_EXISTS;
} else return NO_SUCH_PAGE;
}
}
(Review ID: 113610)
======================================================================
Name: rmT116609 Date: 12/15/2000
java version "1.3.0"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.3.0-c)
Java HotSpot(TM) Client VM (build 1.3.0-c, mixed mode)
Not sure of the steps on this one. I was printing to a Graphics object obtained
through a call to PrinterJob.getPrinterJob() as below:
PrinterJob pj = PrinterJob.getPrinterJob();
PageFormat pf = pj.pageDialog(pj.defaultPage());
if (pj.printDialog()) {
pj.setPrintable(report);
pj.print();
}
The print method for the report reference above is:
public int print(Graphics c, PageFormat pf, int index) {
/*
* This printable will always print only one page, so
* if this is not page 0, return NO_SUCH_PAGE
*/
if (index > 0) {
return NO_SUCH_PAGE;
}
else {
try {
/*
* Read a series of JLabels from our Panel and print to the printer
*/
int leftMargin = (new Double(pf.getImageableX() * 72)).intValue();
int topMargin = (new Double(pf.getImageableY() * 72)).intValue();
for (int i = 0; i < panel.getComponentCount(); i++) {
(JLabel) label = (JLabel) panel.getComponent(i);
g.setFont(label.getFont());
g.drawString(label.getText(), label.getLocation().x + leftMargin,
label.getLocation().y + topMargin + label.getFont().getSize());
}
return PAGE_EXISTS;
}
catch(Exception ex) {
ex.printStackTrace();
return NO_SUCH_PAGE;
}
}
}
After running the program the following error was reported:
#
# HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4F533F57494E13120E43505002D4
#
(Review ID: 113872)
======================================================================
Name: yyT116575 Date: 01/03/2001
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
After the user pressed 'ok' on the PrintDialog that my program offers him, the
following console message is displayed and the program exits.
#
# HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4F533F57494E13120E43505002D4
#
abnormal program termination
The program code is as follows:
import java.awt.*;
import java.awt.print.*;
import java.awt.event.*;
public class PrinterPanel extends Panel implements ActionListener, Printable
{
CPanel cPanel; //panel to be printed
Button bPrint;
Button bCancelPrint;
Button bPageSetup;
PrinterJob printerJob;
PageFormat pageFormat;
Label message;
//static boolean printMode=false;
PrinterPanel(CPanel cPanel)
{
this.cPanel = cPanel;
bPrint = new Button("Print");
bCancelPrint = new Button("Cancel Printing");
bPageSetup = new Button("Page Setup");
message = new Label("Please wait ...");
printerJob = PrinterJob.getPrinterJob();
bPrint.addActionListener(this);
bCancelPrint.addActionListener(this);
bPageSetup.addActionListener(this);
setLayout(new FlowLayout(FlowLayout.LEFT));
setBackground(new Color(22,44,22));
add(bPrint);
add(bCancelPrint);
add(bPageSetup);
add(message);
message.setVisible(false);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource() == bPrint)
{
printerJob.setPrintable(this);
if(printerJob.printDialog())
{
try
{
printerJob.print();
}
catch(PrinterException pe)
{
System.out.println(pe.getMessage());
}
}
}
else if(ae.getSource() == bCancelPrint)
{
if(!printerJob.isCancelled())
{
System.out.println("Cancelling print job.");
printerJob.cancel();
}
}
else
{
pageFormat = printerJob.pageDialog
(printerJob.defaultPage());
printerJob.setPrintable(this, pageFormat);
}
}
public int print(Graphics g, PageFormat pf, int pgIndex)
{
//g = g.create((int)pf.getImageableX(), (int)pf.getImageableY
(), (int)pf.getImageableWidth(), (int)pf.getImageableHeight());
if(pgIndex > 0)
return Printable.NO_SUCH_PAGE;
//printMode=true;
printChart(g, pf);
/*switch(wa.mode)
{
case 0:
wa.drawPie(g);
break;
case 1:
wa.drawBar(g);
break;
case 2:
wa.drawLG(g);
break;
}*/
return Printable.PAGE_EXISTS;
}
public void printChart(Graphics g, PageFormat pf) //function to
position various panels and print them
{
int originX = (int)pf.getImageableX();
int originY = (int)pf.getImageableY();
int imageableWidth = (int)pf.getImageableWidth();
int imageableHeight = (int)pf.getImageableHeight();
/*System.out.println(selectedFile);
System.out.println(cPanel.titlePanel.disp.title);
cPanel.titlePanel.disp.title += selectedFile;
System.out.println(cPanel.titlePanel.disp.title);*/
Graphics g1 = g.create(originX, originY,
cPanel.disp.w1+cPanel.disp.w2, cPanel.disp.h1);
cPanel.titlePanel.draw(g1);
Graphics g2 = g.create(originX, originY+cPanel.disp.h1,
cPanel.disp.w1, cPanel.disp.h1);
cPanel.stubPanel.draw(g2);
Graphics g3 = g.create(originX+cPanel.disp.w1,
originY+cPanel.disp.h1, cPanel.disp.w1+cPanel.disp.w2,
cPanel.disp.h1+cPanel.disp.h1);
cPanel.rulerCanvas.draw(g3);
Graphics g4 = g.create(originX,
originY+cPanel.disp.h1+cPanel.disp.h1, cPanel.disp.w1,
cPanel.disp.h1+cPanel.disp.h1+cPanel.disp.h2);
cPanel.machCanvas.draw(g4);
Graphics g5 = g.create(originX+cPanel.disp.w1,
originY+cPanel.disp.h1+cPanel.disp.h1, cPanel.disp.w1+cPanel.disp.w2,
cPanel.disp.h1+cPanel.disp.h1+cPanel.disp.h2);
cPanel.chartCanvas.displayChart(g5);
Graphics g6 = g.create(originX,
originY+cPanel.disp.h1+cPanel.disp.h1+cPanel.disp.h2,
cPanel.disp.w1+cPanel.disp.w2,
cPanel.disp.h1+cPanel.disp.h1+cPanel.disp.h2+cPanel.disp.h1);
cPanel.messagePanel.draw(g6);
}
}
(Review ID: 114532)
======================================================================
Name: krC82822 Date: 02/18/2001
java version 1.3.0
Java (TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot (TM) Client VM (build 1.3.0-C, mixed mode)
This code works fine:
if (pj.printDialog()){
try{
pj.print();
}
catch (PrinterException pe){
System.out.println("Exception while printing.\n");
pe.printStackTrace();
}
}
This code results in an error and abnormal termination of program:
try{
pj.print();
}
catch (PrinterException pe){
System.out.println("Exception while printing.\n");
pe.printStackTrace();
}
The exact error statement reads:
#HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
#Please report this error at
#http://java.sun.com/cgi-bin/bugreport.cgi
#
#Error ID: 4F533F57494E13120E43505002D4
Please note the following:
(1) I am using the Windows Me operating system.
(2) I am a novice developer. However, the only difference between
the working code and the code that results in the error is that
the working code is blocked within an IF statement that calls
the printer dialog.
(Review ID: 117193)
======================================================================
Name: yyT116575 Date: 02/26/2001
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
i want to make a program to print the image . when i cliked on ok to
PrintDialog it wil give error like as under..........
#
# HotSpot Virtual Machine Error, EXCEPTION_FLT_INVALID_OPERATION
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4F533F57494E13120E43505002D4
#
abnormal program termination
(Review ID: 117628)
======================================================================
Name: krC82822 Date: 08/28/2001
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
D:\tutorial\2d\printing\example-1dot2>java ShapesPrint
Unexpected Signal : EXCEPTION_FLT_INVALID_OPERATION occurred at PC=0x66c8ea
Function name=(N/A)
Library=(N/A)
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
- duplicates
-
JDK-4436970 Printing with HotSpot Flags "-Xint" causes VM crash on Windows98 japanese
- Closed
-
JDK-4488418 java/awt/print/PrinterJob/PrintImages/PrintImages.java failing
- Closed
- relates to
-
JDK-4860749 REGRESSION: Wrong double calculation result for Pi (Windows only)
- Resolved
-
JDK-4644270 EXCEPTION_FLT_DIVIDE_BY_ZERO with Floating Point Arithmetic using external dll
- Closed