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

Text on tab not shown properly when using Scroll Tab Layout policy

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 1.4.1, 1.4.2
    • client-libs
    • beta
    • x86
    • windows_nt, windows_xp



        Name: jk109818 Date: 08/07/2003


        FULL PRODUCT VERSION :
        java version "1.4.1_01"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
        Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

        FULL OS VERSION :
        Windows NT Version 4.0

        A DESCRIPTION OF THE PROBLEM :
        Created a JTabbedPane with Scroll tab Layout policy.
        Added 4 Scrollpanes to the tab.
        Resized the frame so that all the tabs dont fit within the screen.
        the last tab is shown as cutt off in between instead of showing ellipsis

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Created a JTabbedPane with Scroll tab Layout policy.
        Added 4 Scrollpanes to the tab.
        Resized the frame so that all the tabs dont fit within the screen.
        the last tab is shown as cutt off in between instead of showing ellipsis

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        expected to ellipsis(...)when the text doesnt fit within the tab
        ACTUAL -
        Tet in the tab is cutt off in between

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import javax.swing.*;
        import java.text.*;
        import java.awt.*;

        public class Tabs {
          public static void main(String args[]) {
            String[] months = new DateFormatSymbols().getShortMonths();
            JTabbedPane pane = new JTabbedPane();
            pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
            pane.setTabPlacement(JTabbedPane.TOP);
            for (int i=0; i < 12; i++) {
              JPanel panel = new JPanel(new BorderLayout());
              JButton button = new JButton(months[i]);
              panel.add(button);
              pane.add(months[i], panel);
            }
            JFrame frame = new JFrame("Tabs");
            frame.getContentPane().add(pane, BorderLayout.CENTER);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(300, 200);
            frame.show();
          }
        }
        ---------- END SOURCE ----------
        (Incident Review ID: 193772)
        ======================================================================

              alexp Alexander Potochkin (Inactive)
              jkimsunw Jeffrey Kim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: