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

Want tabs in JTabbedPane to stretch to full width of pane

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.1.6
    • client-libs



      Name: diC59631 Date: 07/14/98


      I'd like a way to specify that the tabs in a
      JTabbedPane should stretch to the full width of
      the pane. At present they leave an annoying gap
      on the right.

      Here's an example:

      import java.awt.*;
      import com.sun.java.swing.*;

      public class jtb2 extends JFrame

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

          public jtb2()
            { super("jtb2");

      Container c = getContentPane();
      c.setLayout(new BorderLayout());

      JTabbedPane tabs = new JTabbedPane();
      c.add(BorderLayout.CENTER, tabs);

      for (int i = 1; i <= 5; i ++)
      tabs.add("Tab no. " + i, new JButton("Wide Button item illustrating problem with tab sizing"));

      pack(); show();
            }
        }
      (Review ID: 35055)
      ======================================================================

            joutwatesunw Joshua Outwater (Inactive)
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: