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

Painting artifact when a Frame is made non-resizable

XMLWordPrintable

    • x86
    • linux_ubuntu

      When a resizable frame is made non-resizable, the frame repositions itself, but the title bar do not get repainted leaving painting artifacts on screen. When a frame is repeatedly made resizable and non-resizable, the frame moves down.

      To reproduce, run the below test. Repeatedly click on 'Resizable' checkbox.

      This is reproducible with Ubuntu 8.04

      import java.awt.*;
      import java.awt.event.*;

      public class Test {
          public static void main(String[] args) {
              final Frame f = new Frame();
              f.setSize(100, 100);
              f.setLayout(new FlowLayout());
              Checkbox cb = new Checkbox("Resizable", true);
              cb.addItemListener(new ItemListener() {
                  public void itemStateChanged(ItemEvent event) {
                      if (event.getStateChange() == ItemEvent.SELECTED) {
                          f.setResizable(true);
                      } else {
                          f.setResizable(false);
                      }
                  }
              });
              f.add(cb);
              f.setVisible(true);
          }
      }

            denis Denis Fokin (Inactive)
            gramachasunw Girish Ramachandran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: