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

Usage of background colors and setOpaque(true) is confusing and inconsistent.

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Version:
      6
    • CPU:
      generic, x86
    • OS:
      windows

      Description

      The usage of setOpaque is essentially an implementation detail to speed up drawing but because certain standard components change their drawing behavior when setOpaque is set to false this has created confusion about setOpaque really means. Adding to this confusion is the advent of L&Fs which use OS derived skins. It is unclear how a skinned component should be drawn when a developer sets the background color to something other than the default. Should the color be ignored, should it replace the skin, or should it augment the skin somehow. Currently this behavior is inconsistent and depends on the component and the current look and feel and running platform. To further complicate matters, JButton has extra properties to control when the content should be painted, but only JButton has these properties.

      Once a compatibility API is in place we should define and document exactly how all of these properties fit together, especially in the light of forward looking native look and feels for Mac OS X and Vista.

      Once this issue is settled several related bugs regarding buttons and toolbars will have solutions. (see attached bug ids).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              amrsahu Amresh Sahu
              Reporter:
              jmarinacsunw Joshua Marinacci (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Imported:
                Indexed: