This error message occurs when I try to pass a text area into a listener object. I have instantiated all objects so I shouldn't get the error. It is called in the action performed method, and it should be using the class instance variable after it is constructed. I tried instantiating in constructor and as member variable globally. Nothing works. I don't really understand what the problem is other than somehow it is making the inner class object before the outerclass. not possible. I am running windows xp pro, java6. Thank you in advance for the help.
You are using the subclass of KnowledgeListener eg InstructionListener. Now KnowledgeListener is abstract. I noticed in the InstructionListener or any concrete KnowledgeListener classes, where are the FileSaver and JTextArea parms coming from in order to call super()? Since all classes are public meaning in separate source files, these 2 parms can't be from the GUIInputter class. So you may need to change those concrete constructors of KnowledgeListener to pass in FileSaver and JTextArea too. Also where is the sentence variable coming from for the InterrogativeSentence class?
So it looks to me that any other 3 variables are null. You need to find out which one.
If you are in doubt in passing the parms correctly, try printing out the variables in the constructor/method of those action listeners.
I don't really understand what the problem is other than somehow it is making the inner class object before the outerclass. not possible.
How is it *not* possible? You are instantiating inner classes, which depends on variables, of the outer class, which you haven't instantiated yet -- so they are assigned to null. Now, you do complete initialization of the outer class later, but that is already too late for the inner class, as they got a copy of the null references.
Henry
This message was edited 2 times. Last update was at by Henry Wong
Thank you for your help. I put a test for the JTextArea object in actionPerformed, and it works. It did not instantiate in the sequence I thought it would. I now have to work on the design. A thousand and three thank you's