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

JSplitPane: Divider too big

XMLWordPrintable

    • hopper
    • x86
    • windows_nt, windows_2000
    • Verified



      Name: ssT124754 Date: 03/26/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      If I create a JSplitPane (in horizontal orientation) and add a component (at
      top or bottom) wich has a very big height in preferredSize, the divider is
      drawn with about 50 or more pixels height. An explicit setting of the divider
      height has no effect.

      Thorsten

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

      /**
       * Title:
       * Description:
       * Copyright:
       * Company:
       * @author Thorsten Guenther
       * @version $Id$
       */

      public class run extends JFrame
      {
        BorderLayout borderLayout1 = new BorderLayout();
        JSplitPane jSplitPane1 = new JSplitPane();
        JScrollPane jScrollPane1 = new JScrollPane();
        JScrollPane jScrollPane2 = new JScrollPane();

        public run()
        {
          try
          {
            jbInit();
          }
          catch(Exception e)
          {
            e.printStackTrace();
          }
      setSize(1024, 768);
      setVisible(true);
        }

        public static void main(String[] args)
        {
          run run1 = new run();
        }
        private void jbInit() throws Exception
        {
          this.getContentPane().setLayout(borderLayout1);
          jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT);
          jScrollPane1.setPreferredSize(new Dimension(100, 2000));
          this.getContentPane().add(jSplitPane1, BorderLayout.CENTER);
          jSplitPane1.add(jScrollPane1, JSplitPane.TOP);
          jSplitPane1.add(jScrollPane2, JSplitPane.BOTTOM);
        }
      }
      (Review ID: 119470)
      ======================================================================

            apikalev Andrey Pikalev
            ssultanasunw Shaheen Sultana (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: