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

JScrollPane's margin is not updated correctly.

    Details

    • Subcomponent:
    • Resolved In Build:
      swing1.0fcs
    • CPU:
      x86
    • OS:
      windows_95

      Description

      Here is the test case:
      When resize the container which has a JScrollPane, the margin which was set through Insets is not updated. It happens only when resize vertically.

      To re-generate it follow these steps.
      - Try to resize the main frame vertically up and down by your mouse.

      //
      // Test Case By Kim Bae-Chul
      //

      import java.awt.*;
      import java.io.*;
      import java.util.*;
      import java.awt.event.*;
      import com.sun.java.swing.*;
      import com.sun.java.swing.border.*;


      public class Test extends JFrame
      {
          public Test(){
              super("Test Suite");
              setBackground(Color.lightGray);

              JScrollPane scrollPane = new JScrollPane();
              scrollPane.setBorder(new EmptyBorder(new Insets(30,10,30,10)));
      scrollPane.getViewport().add(new SourcePanel());


              add("Center", scrollPane);
      setSize(200, 200);
              show();
          }

          public static void main(String args[]){
              Test frame = new Test();
          }
      }


      class SourcePanel extends JPanel
      {
          JLabel id, name, size, location, locOnScreen, font, background, foreground;

          public SourcePanel(){
              super();
      setLayout(new GridLayout(8, 1));
              setBorder(new TitledBorder(" Source "));

      add(id = new JLabel("Current Event ID: "));
      add(name= new JLabel(" Name: "));
      add(size = new JLabel("Size: "));
      add(location = new JLabel("Location: "));
      add(locOnScreen = new JLabel(" LocationOnScreen: "));
      add(font = new JLabel(" Font: "));
      add(background = new JLabel(" Background: "));
      add(foreground = new JLabel(" Foreground: "));
      }

      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sswingtrsunw Swingtraq Swingtraq (Inactive)
                Reporter:
                bkimsunw Bae-chul Kim (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: