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

SynthScrollBarUI.configureScrollBarColors() should have spec different from the overridden method

    Details

    • Subcomponent:
    • Resolved In Build:
      b86
    • CPU:
      generic
    • OS:
      generic

      Description

      Method SynthScrollBarUI.configureScrollBarColors() has the following specification:

        protected void configureScrollBarColors()
           Overrides:
           configureScrollBarColors in class BasicScrollBarUI

      It inherits empty spec from BasicScrollBarUI.
      In class BasicScrollBarUI method configureScrollBarColors() is called from method installDefaults() which also has empty spec inherited in SynthScrollBarUI. In SynthScrollBarUI method configureScrollBarColors() is not called any more. Specification of one of these two methods must be updated in SynthScrollBarUI class to conform behavior which differs from the parent class.

      Please see the following code sample.
      Uncomment and use /*Basic*/ instead of "Synth" in UI name to observe behavior of the parent class.

      --------------------------------------------------

      import javax.swing.*;
      import javax.swing.plaf.basic.*;
      import javax.swing.plaf.synth.*;

      public class Test {

          public static void main(String[] args) throws Exception {
              SwingUtilities.invokeAndWait(new Runnable() {
                  @Override public void run() {
                      try {
                          UIManager.setLookAndFeel(new SynthLookAndFeel());
                      } catch (UnsupportedLookAndFeelException e) {
                          throw new RuntimeException(e);
                      }
                      doTheTest();
                  }
              });
          }

          private static void doTheTest() {

              new JScrollBar().setUI(new /*Basic*/SynthScrollBarUI() {
                  @Override protected void installDefaults() {
                      super.installDefaults();
                      System.out.println("installDefaults() called");
                  }
                  @Override protected void configureScrollBarColors() {
                      super.configureScrollBarColors();
                      System.out.println("configureScrollBarColors() called");
                  }
              });
          }
      }
      --------------------------------------------------

        Attachments

          Activity

            People

            • Assignee:
              rupashka Pavel Porvatov (Inactive)
              Reporter:
              dbessono Dmitry Bessonov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: