JDK-6895518 : Unable to print to file in default print dialog box on Vista and Windows Server 2008
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u16
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2008
  • CPU: x86
  • Submitted: 2009-10-27
  • Updated: 2011-02-16
  • Resolved: 2010-03-09
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.
JDK 6
6-poolResolved
Related Reports
Duplicate :  
Description
Environment: 
Windows Server 2008 or Windows Vista 
J2SE 6.0 update 16 
 
To reproduce: 
- Launch the Java2Demo.jar in the jdk1.6.0_16/demo/plugin/jfc/Java2D folder of the Java installation 
- Click on any tab, for example Arc_Curves 
- Select 'Tools' in the Global Controls 
- Click on a print button
- Select 'Print to file' 
- Click print 
- On the file chooser dialog Select desktop. 
- Press OK 
- A dialog pops up indicating "Cannot write to file" 
- Also, it is not possible to create a subfolder via this file chooser. 
 
The error occurs even thoug the user has permissions to write on the Desktop or any other folders. Java applications can write to file, only the print to file feature seems to suffer from this issue.

Disabling Vista UAC makes not difference.

Comments
EVALUATION I believe this issue is connected with CR 4939819 (File.canWrite() returns false for the "My Documents" directory) which was fixed for JDK7. In some occasions File.canWrite() method returns FALSE, which disables further operations with this file via Swing dialogs.
17-12-2009