JDK-6429174 : Scroll bar moves when clicked on Intersecting Areas of two Scrollbars in Textarea.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: other
  • Submitted: 2006-05-23
  • Updated: 2011-01-19
  • Resolved: 2006-06-30
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 b91Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Steps to reproduce the defect, Reproducible only on Solaris (9 and 10);
works fine in 1.5.0 and reproducible only in 1.6.0

1. Create a Text Area.
2. Enter some text into it so that horizontal and vertical scrollbar comes up
3. move the vertical scroll bar to top and horizontal scroll bar to left.
4. move the mouse pointer on the area where in horizontal and vertical scroll bar
   meets.


Expected result: mouse pointer should be "Arrow"
Actual result: mouse pointer is "I" (editable sign)

5.click on Bottum Right corner where in harizontal and vertical scroll bar meets.
Expected result: Nothing should happen
Actual result: Vertical scroll bar starts moving Downwards,


Run the following Code to reproduce the defect.


import java.awt.*;

public class TestScrollBar {
    public static void main (String argv[]) {
        
	Frame f =new Frame ("Java Frame");
        f.setSize(800,800);
        f.setLayout(new FlowLayout());
        TextArea ta = new TextArea();
        ta.setBackground(Color.BLUE);
        f.add(ta);
        f.setVisible(true);

        }
}

Comments
SUGGESTED FIX --- XTextAreaPeer.java 2006-06-06 17:34:28.000000000 +0400 *************** *** 337,345 **** scrollBar = textPane.getHorizontalScrollBar(); comp = getScrollBarComponentUnderMouse(scrollBar, e); } ! ! if ((comp == null) && (!isGrabbedComponent)) { // This event is for the text area. ! pSetCursor(target.getCursor());// Update cursor JViewport port = textPane.getViewport(); Point p = port.getViewPosition(); --- 337,348 ---- scrollBar = textPane.getHorizontalScrollBar(); comp = getScrollBarComponentUnderMouse(scrollBar, e); } ! ! if ((comp == null) && !textPane.getViewport().getBounds().contains(e.getX(), e.getY())) { ! // probably intersection of two scrollbars ! pSetCursor(textPane.getCursor()); ! } else if ((comp == null) && (!isGrabbedComponent)) { ! // this event is for the text area. pSetCursor(target.getCursor());// Update cursor JViewport port = textPane.getViewport(); Point p = port.getViewPosition();
06-06-2006

EVALUATION There is a wrong assumption in XTextAreaPeer code: if mouse event is outside of both scrollbars then it is in the text area itself. We should check this situation and do nothing for mouse events for the area of intersection of two scrollbars.
06-06-2006

EVALUATION Pressing that area changes current text cursor position within TextArea to last character in the the line. It seem scrollbar just reacts on position change. This is XAWT specific.
23-05-2006