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

disabling a container should recursively disable its child components

XMLWordPrintable

    • generic, sparc
    • generic, solaris_2.4

      Currently, if a container is disabled, it does not recursively call disable() on
      its child components, even though any child peer components will in fact
      become disabled (buttons, fields, etc). Where this is a particular problem is
      when Canvas is subclassed to create a custom component -- in this case
      it will not be disabled properly when its container is disabled.
      =============================
      ###@###.### 1997-12-09
      BugID: 4032770 info:

      Enabling (by setEnable) container which containes disabled components
      doesn't effect such components and the label of those components still remains
      grayed out on SOlaris but Windows.
      On Windows enabling container results to change looking of components, those
      looks like enabled but disabled in fact.

      import java.awt.*;
      import java.applet.*;

      public class Flush2 extends Applet {
              Choice choice1;

              public void init() {
            Button b = new Button("B") ;
                      add (choice1 = new Choice ());
            add (b) ;
                      choice1.addItem (" black ");
            b.setEnabled(true) ;
            choice1.setEnabled(true) ;
            this.setEnabled(false) ;
              }

              public boolean handleEvent(Event evt) {
            if (evt.id == Event.ACTION_EVENT && evt.target instanceof Button) {
               System.out.println("action!") ;
            }
            return true ;
              }
      }

      File Flush2.html
      <html>
      <head>
      <title>Test</title>
      </head>
      <body>

      <APPLET CODE="Flush2.class" WIDTH=480 HEIGHT=240></APPLET>

      </body>
      </html>
      ===========
      On win32 run two applets at the same time to see the difference . One with this.setEnable(false) and other with this.setEnable(true) or comment out this line. There is no difference between them.

            rramsunw Ranganathan Ram (Inactive)
            amfowler Anne Fowler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: