Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6745218

Scroll buttons on wrapped tabbed panes in RTL layout not showing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • client-libs

      FULL PRODUCT VERSION :
      5.0-6.0

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Scroll buttons on wrapped tabbed panes in RTL layout not showing. This is a bug in BasicTabbedPaneUI.TabbedPaneScrollLayout class (see below for a fix)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a tabbed pane in WRAP_TAB_LAYOUT mode with RTL orientation and a number of tabs. Under *all* core LAFs (Metal, Windows, Motif) the scroller buttons (on TOP and BOTTOM placement) are not showing.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Scroller buttons showing on the left-hand side of the tabbed pane on TOP and BOTTOM placement
      ACTUAL -
      No scroller buttons

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      The code from line 2756 as
                                    case BOTTOM:
                                    case TOP:
                                    default:
                                      int totalTabWidth = rects[tabCount-1].x + rects[tabCount-1].width;

                                      if (totalTabWidth > tw) {
                                          visible = true;
                                          bx = (child == tabScroller.scrollForwardButton)?
                                              bounds.width - insets.left - bsize.width :
                                              bounds.width - insets.left - 2*bsize.width;
                                          by = (tabPlacement == TOP? ty + th - bsize.height : ty);
                                      }

      is correct only for LTR orientation. For RTL, it should check the rects[tabCount-1].x, and if it's negative, set visible to true and bx to either insets.left or insets.left + bsize.width.

      This is impossible to do in custom LAF since almost everything (including the layout class) is private.

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: