United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6300270 : RE 1.5.0_04 copy and paste fails in Modal JDialog

Details
Type:
Bug
Submit Date:
2005-07-21
Status:
Resolved
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2006-01-07
Component:
client-libs
OS:
linux,windows_2000
Sub-Component:
java.awt
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0u4,6
Fixed Versions:
5.0u7 (b01)

Related Reports
Backport:
Backport:
Duplicate:

Sub Tasks

Description
Cut and Paste to a an applet with a JTextField in a Modal JDialog fails on Windows 2000 with jdk 1.5.0_04

This seems related to CR # 5086496 but there are no errors with this particular test case as there aer with that CR.  It simply doesn't cut and paste.  Thus the filing of this CR.

Attached is the test case.  It is also in  /net/cores.central/cores/64566869

Tested 1.4.2_08, 1.4.2_10, 1.5.0, and 1.5.0_04.
Note: 1.4.2_10 was tried because of another cut and paste bug with applets.
This second bug, CR # 4856343
I tried the following build:
	
j2sdk-1_4_2_10-nb-bin-20050622-windows-i586-22_jun_2005.exe
which is available at:
/net/re450.sfbay/export/d4/jdk142nn-nightly/bundles/windows-i586/b00-2005-06-22
	
All versions fail for the modal case and _08 also fails for the non-modal case.
	
        To reproduce:
        
   1) open the JavaTest.html file from /net/cores.central/cores/64566869 in IE.  
        
   2) Copy some text from WordPad and place it in the text box next to the "Name:"
        label.  This should work fine (except on 1.4.2_09 or earlier).  
        
   3) Then click the Non-Modal button.  A JDialog should open with a text
      box next to a "Name:" label.  Cut and paste should work fine here too
      (except on 1.4.2_09 or earlier).
        
   4) Close the JDialog
        
   5) Click the Modal button and a Modal JDialog should open with a text box
      next to a "Name:" label.
        
   6) Cut and paste to the Modal JDialog should fail.

###@###.### 2005-07-21 20:29:55 GMT

                                    

Comments
EVALUATION

Copy/Paste is not possible when there is no clipboard access permission. It's also the default when no .java.policy file exists.

-----
When a modal dialog is shown, the user code is in the stack. Hence SecurityManager.checkSystemClipboardAccess() reports that the system clipboard access is  forbidden. We need to do event processing in modal dialog inside AccessController.doPrivileged. In this way, it wouldn't matter even if the user code is in stack.
                                     
2005-08-02
WORK AROUND

Provide java.awt.AWTPermission "accessClipboard" on .java.policy file
                                     
2005-08-02



Hardware and Software, Engineered to Work Together