Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6692619
Votes 0
Synopsis Component is missing after changing the z-order of the component & focus is not transfered in
Category java:classes_awt
Reported Against
Release Fixed 6u10(b23)
State 10-Fix Delivered, bug
Priority: 1-Very High
Related Bugs 6616323
Submit Date 23-APR-2008
Description
I have a jframe which contains 4 buttons. I change the make the first button as the focus owner & change the z-order of the 2nd button, the component is shifted i,e z-order is applied but a component is remove or hidden . After i am pressing tab to change the focus , but focus is not transfered. This works fine in 6u10_b22 promoted build, fails in 6u10 b23 pit only. This is the regression of http://monaco.sfbay.sun.com/detail.jsf?cr=6616323-2161436. Hence its a regression introduced in pit build.  I have the screen shot of same .

Step to reproduce:-
---------------------
1) Run the attached program . This is an automated testcase.
2) Observe that after the z-order ( b1 is changing its position ) b3 is  missing & focus remains on b1 . If you see the same then the bug is reproduced.
Posted Date : 2008-04-23 10:24:30.0

This bug is reproduced also for awt components with the 6u10 b23 pit build.
However the component is not getting missed but the focus is not transferred to the 
required component after changing the ZOrder. 
getComponentZOrder(Component comp) method is not returing the proper ZOrder index of the component
after changing the ZOrder .

Steps to reproduce:

1. Run the attached automated testcase (ZOrder.java) 
2. Observe that after changing the ZOrder the focus is not transferred to the required component (After pressing tab)
3. Also observe that getComponentZOrder(Component comp) method is returing unexpected values.

Since this is a regression I am increasing the priority .
Posted Date : 2008-04-23 10:49:46.0
Work Around
N/A
Evaluation
When removing the component delicately there is some additional check exists: 
    if (newIndex > index) { 
        newIndex--;
    }
Which were introduced while fixing 6616323 by mistake which is described in the comment just above that extra check:
// If we first remove a component before adding it into higher index (newIndex), 
// then newIndex should be decremented.
But there are also several examples that contradict that statement:
// 2->4: 012345 -> 013425, 2->5: 012345 -> 013452
// 4->2: 012345 -> 014235
So far, even we shift the components left by one position when removing particular element, it's still ok to push it by the newIndex without decrement.
Posted Date : 2008-04-23 13:15:46.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang