JDK-4151707 : Win32 regression: 1.1 printing is broken
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.2.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1998-06-23
  • Updated: 1999-01-15
  • Resolved: 1999-01-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.2.0 1.2beta4Fixed
Related Reports
Relates :  
Description
The test program 
test/java/awt/PrintJob/PrintComponentTest/PrintComponentTest.java
no longer produces correct output.

Because of changes to the java.util package, you will first need to apply this
patch to get the .java file to compile correctly:


------- PrintComponentTest.java -------
*** /tmp/dma_R1_        Tue Jun 23 15:30:32 1998
--- PrintComponentTest.java     Tue Jun 23 14:31:03 1998
***************
*** 1,13 ****
  /**
   * PrintComponentTest.java %I% %E%
   * @bug 4111262 4035285 4038900 4046147 4049680 4084038 4100004 4105875
!  * @bug 4117502 4037486 4068433
   * @summary Test printing of lightweight (and heavyweight) components
   */
  
  import  java.awt.*;                     
  import  java.awt.event.*;               
! import  java.util.*;                           
  import  java.applet.*;
  
  public class PrintComponentTest extends Applet {
--- 1,16 ----
  /**
   * PrintComponentTest.java %I% %E%
   * @bug 4111262 4035285 4038900 4046147 4049680 4084038 4100004 4105875
!  * @bug 4117502 4037486 4068433 4128031 4151161
   * @summary Test printing of lightweight (and heavyweight) components
+  * @author dpm
+  * @author robi
   */
  
  import  java.awt.*;                     
  import  java.awt.event.*;               
! import  java.util.Properties;
! import  java.util.Enumeration;
  import  java.applet.*;
  
  public class PrintComponentTest extends Applet {


Now, run the test program as an application (the .html file is incorrect and
will be removed). Select "Print to Printer..." from the "Print" menu. The output
should be three pages which closely resemble the Frame and all its components.
Instead, I see the following problems:

* The output consists of four pages instead of three.
* On the first three pages, only the LWButton (a lightweight Component) appears.
  None of the peered Components appear.
* The text drawn in the LWButton has lines radiating from the upper-left corner
  of the parent rectangle to points on the text itself.

We were unable to determine at what point the extra lines appeared. Native
components stopped printing sometime between 23Apr and 25Apr. Also, don't
bother using beta3 as an example of this test case working correctly. Additional
printing bugs were fixed since beta3 that have changed the output substantially.
Use the current 1.1.7 promotion instead.


Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: 1.2beta4 1.2fcs INTEGRATED IN: 1.2beta4 1.2fcs
14-06-2004

EVALUATION This is two separate bugs. The first two bugs about the number of pages and what appears on them are probably related to the AwtMasterPrinterGraphics code so I am reassigning this bug to classes_awt. The "text radiating lines" bug is due to the way that Java2D renders text during "G.drawString()" under some circumstances. This problem should go away if we fix any of a number of bugs related to inefficient use of GDI functions to render curved paths (see 4152595 and 4152600). Since the primary functional problem seems to be related to the extra pages and the lightweight buttons overwriting everything, and since the 2D related bug seems to have other bugs assigned that address the same problem, I am reassigning this bug to classes_awt which owns the AwtMasterPrintGraphics code... jim.graham@Eng 1998-06-25 The problem resulted from the change made by flar to implement Graphics.create() in terms of clone(). The fields which identify a WPrintGraphics as a master of one page -- hasPageNum and pageNum -- were being copied to subsequent child graphics. These flags should only be set in WPrintGraphics.create(int). To correct the problem, I defined WPrintGraphics.clone() to reset these fields to their default values (false and 0). I also modified WPrintJob.end() to explicitly dispose the master WPrintGraphics for an entire job. This just releases the DC sooner rather than during gc. david.mendenhall@eng 1998-06-26
26-06-1998