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

The JScrollBar.getUI() always returns null

    XMLWordPrintable

    Details

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

      Description



      Name: akC57697 Date: 09/23/97



      The com.sun.java.swing.JScrollBar.getUI() always returns null.

      This happens because JScrollBar.getUI() returns a value of
      protected JScrollBarUI ui field which is overriden and not
      initialized in this class.
      Swing version is 0.4.1

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

        JScrollBar c = new JScrollBar();
        
        c.updateUI(); // Set the default UI
        System.out.println(c.getUI().getMinimumSize(c)); // Try to work with the UI
       }
      }
      -------------------Output------------------------------------
      java.lang.NullPointerException
      at JScrollBarUItest.main(JScrollBarUItest.java:10)

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

        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: