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

erase of remove'd component incomplete in 1.1.6

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.6
    • client-libs
    • x86
    • windows_95



      Name: moC74494 Date: 06/15/98


      The foillowing test program worked as expected in
      1.1.5 and earlier. When the OK button is pressed
      the entire panel is erased and a new panel with
      one TextField is displayed.
      On 1.1.6, most of the time, only enough of the
      removed panel is erased to display the TextField.
      The rest of the removed panel remained on the
      screen.
      If the ScrollPane is replaced by a Panel, it seems
      to work fine under 1.1.6.

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

      public class test extends Frame implements ActionListener {
          public static test tb;
          static Panel mainpwin;
          static ScrollPane sp;
          static Panel p1;
          static Panel p2;

          test() {
              super();
          }

          public static void main(String args[]) {

              tb = new test();
              mainpwin = new Panel();
              sp = new ScrollPane();
              p1 = new Panel();
              p1.setLayout(new GridLayout(2,1));
              Button b1 = new Button("OK");
              b1.addActionListener(tb);
              b1.setActionCommand("OK");
              p1.add(b1);
              p1.add(new Button("No"));
              sp.add(p1);
              mainpwin.add(sp, BorderLayout.CENTER);
              tb.add(mainpwin);
              tb.pack();
              tb.setVisible(true);
          }

          public void actionPerformed(ActionEvent e) {
              String s = e.getActionCommand();

              if ("OK".equals(s)) {
                  sp.remove(p1);
                  invalidate();
                  p2 = new Panel();
                  p2.setLayout(new GridLayout(3,1));
                  p2.add(new TextField("T1"));
                  sp.add(p2);
                  validate();
              }
          }
      }
      (Review ID: 33583)
      ======================================================================

            kboudniksunw Konstantin Boudnik (Inactive)
            moanceasunw Mircea Oancea (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: