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

Deprecate of Enable in java.awt.Component and NOT javax.swing.JComponent

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • docs
    • beta
    • generic, x86
    • generic, windows_nt



      Name: ssT124754 Date: 02/07/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      I experienced a problem using the JButton.
      Without thinking I used following two
      functions, which did not work.

      public void javax.swing.Jbutton.disable()
      public void javax.swing.Jbutton.enable()


      java.lang.Object
        |
        +--java.awt.Component
              |
              +--java.awt.Container
                    |
                    +--javax.swing.JComponent
                          |
                          +--javax.swing.AbstractButton
                                |
                                +--javax.swing.JButton


      I traced the problem, the javax.swing.JComponent.enable()
      function overides the java.awt.Component.enable() function.
      These functions are Deprecated.

          void java.awt.Component.disable()
                Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).
          void java.awt.Component.enable()
                Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).
          void java.awt.Component.enable(boolean b)
                Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).

      I used the replacement function which worked fin.
          void javax.swing.AbstractButton.setEnabled(boolean b)
      (Review ID: 116506)
      ======================================================================

            sharonz Sharon Zakhour (Inactive)
            ssultanasunw Shaheen Sultana (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: