🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.gui
Article #9

Q: NullPointer Exception in event dispatching

#9
From: 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)
Technical Details
Message-ID: <35B94428.79713250@mtu.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10fd6d,2150a7ac5e41a611,start
X-Google-Attributes: gid10fd6d,public
X-Google-Thread: f74b3,2150a7ac5e41a611,start
X-Google-Attributes: gidf74b3,public
X-Google-Thread: 10a146,2150a7ac5e41a611,start
X-Google-Attributes: gid10a146,public
X-Google-Thread: ff01d,2150a7ac5e41a611,start
X-Google-Attributes: gidff01d,public
From: yzhou <yzhou@mtu.edu>
Subject: Q: NullPointer Exception in event dispatching
Date: 1998/07/24
Message-ID: <35B94428.79713250@mtu.edu>
X-Deja-AN: 374700647
Content-Transfer-Encoding: 7bit
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Michigan Tech
Mime-Version: 1.0
Newsgroups: comp.lang.java.gui,comp.lang.java.programmer,borland.public.jbuilder.java.language,borland.public.jbuilder.applet-issues