I have a little app, which displays a JTextArea linked to a subclass
of Abstract Document.The document contains a text and has an element
structure on top of it.
From want to change the contents of an element from the outside by
calling the set method, which is supposed to update the Document class
and subsequently the JTextArea.
The problem is, whenever I call set(String) from the ActionHandler I
get a NullPointerException which I dont understand:
setting field at 8 to:hallo...key0,8,12: Start:8 END:12
inserting:hallo
java.lang.NullPointerException
at javax.swing.text.PlainView.getLineWidth(PlainView.java:612)
at javax.swing.text.PlainView.updateDamage(PlainView.java:523)
at javax.swing.text.PlainView.insertUpdate(PlainView.java:407)
at javax.swing.plaf.basic.BasicTextUI$RootView.insertUpdate(BasicTextUI.java:1416)
at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.insertUpdate(BasicTextUI.java:1650)
at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:184)
at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:748)
at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:705)
at playground.types.CustomString.set(CustomString.java:77)
at playground.TestInp.actionPerformed(TestInp.java:83)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1767)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1820)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:258)
at java.awt.Component.processMouseEvent(Component.java:5021)
at java.awt.Component.processEvent(Component.java:4818)
at java.awt.Container.processEvent(Container.java:1380)
at java.awt.Component.dispatchEventImpl(Component.java:3526)
at java.awt.Container.dispatchEventImpl(Container.java:1437)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3214)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2929)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2859)
at java.awt.Container.dispatchEventImpl(Container.java:1423)
at java.awt.Window.dispatchEventImpl(Window.java:1566)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
Maybe you can give me a wink with the clue stick :o)
"Robert" <takkfor...@gmx.net> wrote in message
news:dbcf9875.0207...@posting.google.com...