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

The method java.awt.swing.JScrollBar.setOrientation(int) does not check paramete

XMLWordPrintable

    • swing1.0fcs
    • sparc
    • solaris_2.5.1
    • Verified



      Name: akC57697 Date: 11/19/97



      The method setOrientation(int) does not check parameter
      which must be SwingConstants.VERTICAL or SwingConstants.HORIZONTAL
      only.

      -------------------Example-----------------------------------
      import java.awt.swing.*;
      public class TestJScrollBar {

          public static void main(String s[]) {
             JScrollBar c= new JScrollBar();
               try {
                c.setOrientation(SwingConstants.VERTICAL+1000000);
                c.setOrientation(SwingConstants.VERTICAL-1000000);
               } catch (IllegalArgumentException e) {
                         System.exit(0);
                        }
                 catch (Exception e) {
                         System.out.println("Unexpected "+e);
                        }
                    System.out.println("No reaction on invalid parameter.");
                    System.exit(0);
          }
      }
      -------------------Output------------------------------------
      (novo35 46): java -fullversion
      java full version "JDK1.2U"
      (novo35 47): javac TestJScrollBar.java
      (novo35 48): java TestJScrollBar
      No reaction on invalid parameter.

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

            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: