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

NULLPOINTEREXCEPTION IN SETVISIBLE() IF TOOLKIT HASN'T BEEN CREATED

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: eyC74480 Date: 03/03/98


      This bug report came from Oracle Corp. JavaSoft Licensee.
      ======================================================================


      john.stampfl@eng 1999-05-11
      received testcase from Oracle


      /*This is JavaSoft licensee Oracle Corp.
      If setVisible() is called on a component that has a ComponentListener
      attached, before anyone has called Toolkit.getDefaultToolkit()
      (e.g., before any peers have been created), a NullPointerException
      results.

      java version "1.1.7B"

      % java ToolkitTest
      java.lang.NullPointerException
      at java.awt.Toolkit.getEventQueue(Toolkit.java:662)
      at java.awt.Component.hide(Component.java:536)
      at ToolkitTest.main(ToolkitTest.java:17)

      The following code reproduces the problem:
      */
      import java.awt.*;
      import java.awt.event.*;
      public class ToolkitTest extends ComponentAdapter
      {
        static public void main(String[] args)
        {
          Button b = new Button("Blah");
          b.addComponentListener(new ToolkitTest());
          b.hide();
        }
      }

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

        Attachments

          Activity

            People

            Assignee:
            duke J. Duke (Inactive)
            Reporter:
            eyusunw Ellis Yu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: