JDK-6700551 : Increasing the size of a window makes a component clipped
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-05-12
  • Updated: 2011-01-19
  • Resolved: 2008-05-12
Related Reports
Duplicate :  
Description
This is reproducible with jdk7 b27 PIT build. Observed it on Windows XP professional. This is not reproducible with 6u10 b23.

Run the below test. Increase the height of the Frame by dragging down at the bottom border. As the size of the window increases, it could be seen that the list present in the window becomes clipped. 

import java.awt.*;
import java.awt.event.*;
import java.util.StringTokenizer;

public class FrameResizeTest {
    
    public static void main(String[] args) {
        Frame f = new Frame();
        f.setLayout(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridwidth = GridBagConstraints.REMAINDER;

        Panel p = new Panel();
        p.setLayout(new BorderLayout());
        Panel tp = new Panel();
        tp.setLayout(new GridBagLayout());
        List list = new List();
        for (int i = 0; i < 10; i++) {
            list.add("Item" + i);
        }
        tp.add(list, gbc);
        p.add(tp);
        
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weightx = 1;
        gbc.weighty = 0;

        f.add(new Label("A label at North"), gbc);
        gbc.weighty = 4;
        f.add(p, gbc);
        gbc.weighty = 0;
        Panel bp = new Panel();
        bp.add(new Label("A label at South"));
        f.add(bp, gbc);
        f.setSize(400, 200);
        f.setVisible(true);
    }
}