JDK-6722162 : Translucent frame is printed as Opaque
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-07-03
  • Updated: 2011-01-19
  • Resolved: 2008-07-03
Related Reports
Relates :  
Description
I have a frame which contains AWT components. I making the awt frame as translucent from another swing frame which contains a slider. As the slider values change the opacity of the awt frame also changes. When i take a print of the translucent frame, it gets printed as the opaque. I was expecting that translucent frame with translucent components to be printed.

Step to Reproduce :-
---------------------
1) Run the attached testcase. A swing frame is displayed.
2) Click on "ShowAWTFrame" button. An undercorated frame is seen which contains AWT components. 
3) Change the value of the slider by dragging the nob of the slider. Observe that AWT Frame gets translucent.
4) Click on the "PrintAWTComponent" button on the swing frame. A print dialog is seen. Click OK button. Observe the components & frame printed on the paper. If you see them printed as opaque then the bug is reproduced.

Comments
EVALUATION This is not a bug, but a normal behavior. Enabling translucency effects makes sense when displaying frames on the screen because you can observe the content underneath your frame. However, when printing on a paper, there's obviously nothing painted but the white background. That's why using the translucency effects is not feasible when printing and therefore does not affect the printing. The only newly introduced effect (see CR 6633275) that should be taken into account when printing - is the shape of the frame. Also note that per-pixel translucent frames should not print their completely transparent areas (those having alpha == 0).
03-07-2008