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

com.sun.java.swing.JScrollBar.setValues(int,int,int,int) incompatible with spec

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      swing1.0fcs
    • CPU:
      sparc
    • OS:
      solaris_2.5.1
    • Verification:
      Verified

      Description



      Name: akC57697 Date: 09/18/97



      The com.sun.java.swing.JScrollBar.setValues(int,int,int,int) incompatible with
      specification. It does not set minimum < maximum and extent >= 1.

      "
       public void setValues(int newValue,int newExtent,int newMinimum,int newMaximum)
            Ensures that the model is always in a consistent state by enforcing
            the following constraints.

               minimum < maximum
               minimum <= value
               extent >= 1
               value <= maximum - extent
            If neccessary we change newValue and newExtent, newExtent is forced to be
             greater than 0.
      "
      -------------------Example-----------------------------------
      import com.sun.java.swing.*;
      public class TestSetValues {

        public static void main(String[] args) {
            JScrollBar c = new JScrollBar();
            c.setValues(0,0,0,0);
            
            if (!( c.getMinimum()<c.getMaximum() && // Check the state
                c.getMinimum()<=c.getValue() &&
                c.getModel().getExtent()>=1 &&
                c.getValue()<=(c.getMaximum()-c.getModel().getExtent() ))) {
             
             System.out.println("Wrong values:"+c);
             return;
            }
             System.out.println("OKAY");
             return;
        }
      }
      -------------------Output------------------------------------
      Wrong values:com.sun.java.swing.JScrollBar[vertical, value=0, adj=false, extent=0, min=0, max=0, unit=1, block=0]

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

        Attachments

          Activity

            People

            Assignee:
            sswingtrsunw Swingtraq Swingtraq (Inactive)
            Reporter:
            akuzminorcl Alexander Kuzmin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: