JDK-6864297 : Right-to-left oriented JScrollPane is aligned to the wrong direction while resizing the container
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2009-07-24
  • Updated: 2011-01-19
  • Resolved: 2009-08-05
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 7
7 b68Fixed
Related Reports
Relates :  
Relates :  
Description
See details and code sample in the 6526631 CR.
Fix the source code as shown below:

- ComponentOrientation orientation = jTree1.getComponentOrientation();
- if (orientation.isLeftToRight()) {
-     jTree1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
- } else {
-     jTree1.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
- }

+ ComponentOrientation orientation = jTree1.getComponentOrientation();
+ if (orientation.isLeftToRight()) {
+     jScrollPane1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+ } else {
+     jScrollPane1.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+ }

Comments
EVALUATION We should use the previous width of the visible area.
24-07-2009