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

JTabbedPane with SCROLL_TAB_LAYOUT policy does not work for RTL orientation.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: client-libs

      Description

      For Left-to-right component orientation, SCROLL_TAB_LAYOUT policy works properly by displaying scrolling buttons for non-visible tabs. This is not the case for Right-to-left. The following program demonstrates this:

      ---------------------------------- Cut Here --------------------------------

      import java.awt.*;
      import javax.swing.*;

      public class CompOrient extends JFrame {
          private JTabbedPane tab;

          public static void main(String[] args) {
              new CompOrient();
          }

          public CompOrient() {
              tab = new JTabbedPane();
              tab.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
              tab.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
      // tab.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);

              for(int i = 0; i < 10; i++) {
                  JPanel panel = new JPanel();
                  JButton button = new JButton("Button " + i);
                  panel.add(button);
                  tab.add("Tab " + i, panel);
              }

              getContentPane().add(tab);
              setSize(300, 300);
              show();
          }
      }
           
      ---------------------------------- Cut Here --------------------------------

      ###@###.### 2002-12-03

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              elousunw Edmund Lou (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: