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

javax.swing.plaf.metal.MetalBorders.getDesktopIconBorder() throws NullPointerExc

XMLWordPrintable

    • beta
    • sparc
    • solaris_2.6



      Name: mgC56079 Date: 11/10/99



      javax.swing.plaf.metal.MetalBorders.getDesktopIconBorder() throws NullPointerExcpetion,
      but specification says that this method should return border instance for Desctop Icon.

      Example:

      import javax.swing.plaf.metal.*;
      import javax.swing.plaf.metal.MetalBorders;
      import javax.swing.border.Border;

      class Test {
          public static void main(String args[]) {
              Border jdiResult = MetalBorders.getDesktopIconBorder();
              if (!(jdiResult instanceof Border && jdiResult != null)) {
                  System.out.print("getDesktopIconBorder works wrong");
              }
              System.out.print("OKAY");
          }
      }

      Result:
      Exception in thread "main" java.lang.NullPointerException
              at
      javax.swing.plaf.metal.MetalLookAndFeel.getControlDarkShadow(MetalLookAndFeel.java:1078)
              at javax.swing.plaf.metal.MetalBorders.getDesktopIconBorder(MetalBorders.java:552)
              at Test.main(test.java:7)

      Excepted:

      OKAY

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

            amfowler Anne Fowler (Inactive)
            gorsunw Gor Gor (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: