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

Scrollbar peer is enabled erroneously, when the Scrollbar still thinks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.1
    • client-libs
    • x86
    • windows_nt



      Name: sg39081 Date: 08/15/97


      If you set a Scrollbar's maximum (and possibly other attributes?)
      with it disabled, its peer becomes enabled (and it fires
      AdjustmentEvents, etc.), however, it was never explicity enabled
      and even worse, isEnabled() still returns false.

      For example:

      import java.awt.*;
      import java.awt.event.*;

      public class Main extends java.applet.Applet implements MouseMotionListener
      {
          Scrollbar s1 = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, 1);
          BorderLayout bl = new BorderLayout();
          public void init()
          {
              s1.setBackground(Color.red);
           setBackground(Color.blue);
              setLayout(bl);
              add("North", s1);

              addMouseMotionListener(this);

              s1.setEnabled(false);
          }

          public void mouseDragged(MouseEvent e)
          {
              s1.setMaximum(e.getX());
              System.out.println("mouse dragged, scrollbar max set to:
      "+s1.getMaximum()+", isEnabled: "+s1.isEnabled());
          }

          public void mouseMoved(MouseEvent e) {}

      }

      company - Corel , email - ###@###.###
      ======================================================================

      I have a similar complaint from another licensee :

      If setValue is used on a disabled ScrollBar it becomes enabled (i.e. not
      grey out).

      Since there is a simple workaround (check if the scrollbar is enabled
      before setting the value) the impact is low - but this is a bug.

      mick.fleming@Ireland 1998-03-05

      =============================================================================

            xdengsunw Xianfa Deng (Inactive)
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: