-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
1.4.2
-
generic
-
generic
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
---------------------------------- 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
- duplicates
-
JDK-4726740 JTabbedPane(SCROLL_TAB_LAYOUT) doesn't work properly in right-to-left mode.
- Closed