Ahhhh....

From: Connell Gauld (me_at_DINNAYSPAM.com)
Date: 11/29/03

  • Next message: Marcos Fernández: "Re: jmf"
    Date: Sat, 29 Nov 2003 20:27:53 +0000
    
    

    Hi,

    I have a very annoying problem. (I'm running latest version of Sun's J2SDK)
    I have a class which extends a Frame. On the frame I have several TextField
    objects. All are defined as protected in the class. I can use the getText()
    function of these TextField objects without any problems in the constructor
    function (where they are added to the Frame). I have written the class with
    an action(Event evt, Object whichAction) method so that it will react when
    a Button is pressed. I get the following error when I use getText() in this
    method (note qlsettings is the name of the class which extends the Frame):

     java.lang.NullPointerException
            at qlsettings.outer(qlsettings.java:66)
            at qlsettings.action(qlsettings.java:58)
            at java.awt.Component.handleEvent(Component.java:5341)
            at java.awt.Window.postEvent(Window.java:1614)
            at java.awt.Component.postEvent(Component.java:3895)
            at java.awt.Component.dispatchEventImpl(Component.java:3631)
            at java.awt.Component.dispatchEvent(Component.java:3477)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
            at
    java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
            at
    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
            at
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
            at
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

    Help please?

    Thanks
    Connell


  • Next message: Marcos Fernández: "Re: jmf"
  • Quantcast