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

The java.awt.swing.JSeparator.getUI() always returns null

XMLWordPrintable

    • swing0.8
    • sparc
    • solaris_2.5.1
    • Verified



      Name: akC57697 Date: 11/20/97



      The java.awt.swing.JSeparator.getUI() always returns null.

      This happens because JSeparator.getUI() returns a value of
      protected SeparatorUI ui field which is overriden and not
      initialized in this class.

      -------------------Example-----------------------------------
      import com.sun.java.swing.*;
      public class JSeparatorUITest {
        public static void main( String argv[] ) {

        JSeparator s = new JSeparator();
        s.updateUI();
        s.getUI().getMinimumSize(s); // Try to work with the UI
       }
      }
      -------------------Output------------------------------------
      (novo35 57): java -fullversion
      java full version "JDK1.2U"
      (novo35 58): javac JSeparatorUITest.java
      (novo35 59): java JSeparatorUITest
      java.lang.NullPointerException
      at JSeparatorUITest.main(JSeparatorUITest.java:7)
      ======================================================================

            gsaab Georges Saab
            akuzminorcl Alexander Kuzmin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: