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

JScrollPane.setViewportBorder() affects col. header differently in kestrel

XMLWordPrintable

    • Fix Understood
    • x86
    • windows_nt

      Name: krT82822 Date: 02/23/2000


      original synopsis: "JScrollPane.setViewportBorder() no longer affects the column header"

      16 Feb 2000, eval1127@eng -- same behavior with kestrel-rc1 (as with beta).

      In the attached code, the "header" and the "view" are the same width
      (narrower than the enclosing window) in 1.2.2.

      In 1.3 beta AND RC, the "header" (border) is drawn at the full width of the
      enclosing window.

      --------------------------------------

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

      Prior to JDK 1.3 beta, setting the JScrollPane's viewport border via
      setViewportBorder() would cause this border to extend around the left and right
      of the column header (though never the top of the column header). Now, in JDK
      1.3 beta, when you set the border via setViewportBorder(), it does not extend
      around any part of the column header.

      The following is an example program which demonstrates this. Run it on both JDK
      1.3 beta and 1.22 and you should clearly see the difference in the behavior of
      setViewportBorder().


      import javax.swing.*;
      import javax.swing.border.*;

      public class A extends JFrame
      {
         public A()
         {
            super();
            
            JScrollPane sp = new JScrollPane(new JButton("view"));
            
            sp.setColumnHeaderView(new JButton("header"));
            
            
            sp.setViewportBorder(new EmptyBorder(30, 30, 30, 30));
            
            setContentPane(sp);
         }
         
         public static void main(String args[] )
         {
            A a = new A();

            a.setSize(400, 400);
            a.setVisible(true);
         }
      }
      (Review ID: 100038)
      ======================================================================

            Unassigned Unassigned
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: