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

Excessive WINDOW_ICONIFIED and WINDOW_DEICONIFIED events

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.2.0
    • 1.2.0
    • client-libs
    • 1.2fcs
    • sparc
    • generic
    • Not verified

      After a frame is show, remove() and add() a TextComponent or Canvas could cause
       WINDOW_DEICONIFIED and WINDOW_ICONIFIED events so the frame will end up showing in ICONIFIED state.

      import java.awt.*;

      /*
       * Run this test, the frame will be shown in ICONIFIED state
       * because three Window Events were generated:
       * WINDOW_ICONFIED
       * WINDOW_DEICONFIED
       * WINDOW_ICONFIED
       * Deleting the last two lines, frame will show in normal state
       */
      public class ExcessiveTest extends java.applet.Applet {
          static TextField t = new TextField("Nothing is more fun");

          public void init() {
              add("North", new Button("Nothing is more fun"));
              add("South", t);
              // problem identified with three new components so far
              // add("South", new TextArea("Nothing is more fun"));
              // add("South", new TextField("Nothing is more fun"));
              // add("South", new Canvas());
          }

          public static void main(String argv[]) {
              ExcessiveTest a = new ExcessiveTest();

              Frame f = new Frame("Test Frame");
              
              f.add(a);

              a.init();
              a.start();
              f.pack();
              f.setVisible(true);

              // comment out the following two lines, it shows as normal
              a.remove(t);
              a.add(t);
          }
      }

            xdengsunw Xianfa Deng (Inactive)
            xdengsunw Xianfa Deng (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: