🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.java.gui
1 messages
1 total messages Started by yzhou Fri, 24 Jul 1998 00:00
Q: NullPointer Exception in event dispatching
#9
Author: yzhou
Date: Fri, 24 Jul 1998 00:00
56 lines
3235 bytes
Hi, there

    I have a cardLayout consists of one panel for each card.
In the first panel, there is a gridControl(Swing Component) 
which displays a list of items, such as: Item Number, 
Item Name, Last updated time. Users can click on them to select 
one and start editing. Once an item is selected, the applet
switches to the second panel and populates the content
of the selected item, and the focus is set at a textbox.

    The grid accepts double-click event and then populates the
selected item. The problem is that
if I multiple-click(3,4, or more) in the grid, everything is 
still OK except the NullPointer exception. The error message 
from applet viewer is enclosed.

    I guess the grid consumes double-click event, and the rest
of click events is passed onto nextFocusableComponent, but I just
could not figure out why it causes exception.

    Any hint will be appreciated.

					Yan Zhou
					yzhou@mtu.edu


Exception occurred during event dispatching:
java.lang.NullPointerException
          at
com.sun.java.swing.text.Utilities.getRowStart(Utilities.java:166)
          at
com.sun.java.swing.text.DefaultEditorKit$BeginLineAction.actionPerfor
med(DefaultEditorKit.java:1410)
          at
com.sun.java.swing.text.DefaultEditorKit$SelectLineAction.actionPerfo
rmed(DefaultEditorKit.java:1647)
          at
com.sun.java.swing.text.DefaultCaret.mouseClicked(DefaultCaret.java:1
89)
          at java.awt.AWTEventMulticaster.mouseClicked(Compiled Code)
          at java.awt.AWTEventMulticaster.mouseClicked(Compiled Code)
          at java.awt.Component.processMouseEvent(Compiled Code)
          at java.awt.Component.processEvent(Compiled Code)
          at java.awt.Container.processEvent(Compiled Code)
          at java.awt.Component.dispatchEventImpl(Compiled Code)
          at java.awt.Container.dispatchEventImpl(Compiled Code)
          at java.awt.Component.dispatchEvent(Compiled Code)
          at java.awt.LightweightDispatcher.retargetMouseEvent(Compiled
Code)
          at java.awt.LightweightDispatcher.processMouseEvent(Compiled
Code)
          at java.awt.LightweightDispatcher.dispatchEvent(Compiled Code)
          at java.awt.Container.dispatchEventImpl(Compiled Code)
          at java.awt.Component.dispatchEvent(Compiled Code)
          at
java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads