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

JTextComponent.setEditable(false) forces change of component's background

    Details

    • Subcomponent:
    • Introduced In Build:
      b84
    • Introduced In Version:
      6
    • Resolved In Build:
      b96
    • CPU:
      x86
    • OS:
      linux

      Description

      Create a JTextArea and set the background color to some non-default value e.g. gray. Then set editable of this area to 'false'. It forces the change of background color back to default value.
      This behavior introduces semantic in-compatibility between JDK1.4.2/JDK5 release and recent builds JDK6. This causes invalid state of many NetBeans dialogs and in products built of the top NetBeans as well.
      See attached test which shows the problem, run the test /usr/local/share/java/jdk1.6.0/bin/java -ea -jar TestTextAreaBackground.jar.
      Thanks
      I don't agree that JTextComponent's can *correctly* change their background color when they are changed to non-editable in spite of previously set value. This change of JTextComponent has broken tons of dialogs in NetBeans product and even worse in all product built on the top of NetBeans platform.

      The recently released tool Matisse generates code like
      JLabel label = new JLabel();
      textComponent.setBackground(label.getBackground());
      To fix all unexpectedly dialogs we have to fix form generation and then open and re-generate affected forms. Please, could you again think over about this implication and find any possible trade-off? Thanks
      DELETED COMMENT
      DELETED COMMENT

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                shickeysunw Shannon Hickey (Inactive)
                Reporter:
                jrechtac Jiří Řechtáček (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: