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

The java.awt.swing.JSlider.setOrientation(int) does not check params

XMLWordPrintable

    • swing1.0fcs
    • x86, sparc
    • solaris_2.6, windows_nt
    • Verified



      Name: akC57697 Date: 11/23/97



      The java.awt.swing.JSlider.setOrientation(int) does not check params.
      It does not throw IllegalArgumentException.

      -------------------Example-----------------------------------
      import java.awt.swing.JSlider;
      import java.awt.swing.SwingConstants;
      public class JSliderEx {
          public static void main(String s[]) {

              JSlider c = new JSlider(); //step Create JSlider object
                         
               try {
                c.setOrientation(SwingConstants.VERTICAL+123456789);
                c.setOrientation(SwingConstants.HORIZONTAL+123456789);
               } catch (IllegalArgumentException e) {System.exit(0);}
                 
                    System.out.println("No reaction on invalid parameters.");
                    System.exit(0);
         }
      }
      -------------------Output------------------------------------
      javac JSliderEx.java
      (novo35 52): java JSliderEx
      No reaction on invalid parameters.
      (novo35 53): java -fullversion
      java full version "JDK-1.2beta2-V"

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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: