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

com.sun.java.swing.JSplitPane.addImpl() incompatible with spec

XMLWordPrintable

    • sparc
    • solaris_2.5.1



      Name: akC57697 Date: 10/13/97



      The swing-0.5 com.sun.java.swing.JSplitPane.addImpl() incompatible with spec.
      It does not define and does not throw TooManySplitPaneChildren exception.
      The javadoc documentation says:
      "
       addImpl
       protected void addImpl(Component comp,Object constraints,int index)
            Will throw a TooManySplitPaneChildren exception if more than 2
                          ^^^^^^^^^^^^^^^^^^^^^^
            children already exist.

            Overrides:
                  addImpl in class Container
      "

      -------------------Example-----------------------------------
      import java.awt.*;
      import com.sun.java.swing.*;

      public class TestJSplitPane extends JSplitPane {
        public void add(Component comp, Object constraints, int index) {
            try {
             super.addImpl(comp,constraints,index);
            } catch (TooManySplitPaneChildren e) {
                     System.out.println("OKAY");
                     return;}
        }
      }
      -------------------Output------------------------------------
      javac TestJSplitPane.java
      TestJSplitPane.java:8: Class TooManySplitPaneChildren not found in type declaration.
            } catch (TooManySplitPaneChildren e) {
                     ^
      1 error

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

            amfowler Anne Fowler (Inactive)
            akuzminorcl Alexander Kuzmin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: