Ladies, Gentlemen:

Greetings!

If this is FAQ material, please do direct me to the resource. In any
case, here's what I'm up to:

I've spent the last week or so pursuing the material in the Java
Tutorial so thoughtfully provided by the folks at Sun Microsystems. Be
it ever so ambitious, after writing hello world in Java and browsing the
API a bit via the HTML documentation, I decided that for my first
project I would write a text editor utilizing swing.

So far, so good.

I began to add various components to the UI (menus, toolbars) with which
I had a truly encouraging amount of success. I embarked upon the course
of adding an about dialog. This too went off pretty well without a
hitch.

However at the time I added support for document listeners and caret
listeners, I began getting a null pointer exception when I run the
program. This is not too surprising given that I'm butchering my app
together by cutting and pasting from the demo code into my class files.

Now before you get your flamethrowers out, I'm not asking for a
solution! I know I brought this situation on myself; I'm quite certain
I've got 100% syntactically correct code that has a serious logic or
memory allocation problem. I'm not afraid to chase it down, but I'm
having an absolute bitch of a time trying to use jdb. I've just pulled
something off the web called 'wipeout' which looks like a fantastic tool
- however, it dies on the same exception when I pull up my class as a
wipeout project and attempt to debug it with their GUI/jdb wrapper.

I guess what I'm looking for is some solid suggestions for debugging.
Should I write some kind of exception catcher for the null pointer
exception? It happens early in the code execution; here's the dump:

Exception in thread "main" java.lang.NullPointerException:
                  at java.awt.Container.addImpl(Container.java:316)
                  at java.awt.Container.add(Container.java:245)
                  at Tedit.<init>(Tedit.java:100)
                  at Tedit.main(Tedit.java:557)

Are the numbers listed in the dump line numbers in the source code?
bytecode offsets in the class file? Should I just stick to C and remain
a dinosaur?   ;^)

Thanks for any assistance you may be able to provide-
James G. Stallings II



----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to