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

Toolkit.getEventQueue() throws NullPointerException

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description



      Name: saC57035 Date: 07/06/99



      This bug is reproducible in 1.1.X JDK releases only, and it is filed
      for tracking purposes. Feel free to close this report out as integrated
      in JDK 1.2fcs.

      package - visible method Toolkit.getEventQueue() throws
      NulPointerException if Toolkit.getDefaultToolkit() was not
      called previously.

      --------------- Test.java
      import java.awt.*;
      import java.awt.event.WindowListener;
      import java.awt.event.WindowEvent;

      class Dlg extends Panel implements WindowListener {

          Dialog d;
          public Dlg(int width, int height) {
              d = new Dialog(new Frame());
              d.setSize(200, 200);
              d.addWindowListener(this);
          }

          public synchronized void windowOpened(WindowEvent e) {}
          public synchronized void windowClosed(WindowEvent e) {}
          public synchronized void windowClosing(WindowEvent e) {}
          public synchronized void windowIconified(WindowEvent e) {}
          public synchronized void windowDeiconified(WindowEvent e) {}
          public synchronized void windowActivated(WindowEvent e) {}
          public synchronized void windowDeactivated(WindowEvent e) {}

          public void Dispose() {
              d.dispose();
          }
      }

      public class Test {
          public static void main(String [] argv) throws Exception {
            Dlg D = new Dlg(200, 200);
            D.Dispose();
          }
      }
      --------------- Output
      java.lang.NullPointerException
              at java.awt.Toolkit.getEventQueue()
              at java.awt.Window.postWindowEvent()
              at java.awt.Window.dispose()
              at Dlg.Dispose()
              at Test.main()
      ---------------
                  
      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            mbronsonsunw Mike Bronson (Inactive)
            Reporter:
            savzan Stanislav Avzan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: