| Author |
Error while trying to create a JTable
|
Krithika Beri
Ranch Hand
Joined: Sep 11, 2012
Posts: 36
|
|
I am taking elements from a Dom parser and writing its content into a JTable with TreeSelectionListener() of JTree to indicate which node's data is to be displayed.
|
 |
Krithika Beri
Ranch Hand
Joined: Sep 11, 2012
Posts: 36
|
|
I am getting the following error..
HomeWork1 (class=assessment-practice-tests, container_type=homework, displayName=HomeWork1, id=HomeWork1, playOrder=1)
Node name :class
Node Value :assessment-practice-tests
j :0
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Main.tables(Main.java:166)
at Main$2.valueChanged(Main.java:130)
at javax.swing.JTree.fireValueChanged(Unknown Source)
at javax.swing.JTree$TreeSelectionRedirector.valueChanged(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(Unknown Source)
at javax.swing.JTree.setSelectionPath(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressedDND(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4167
|
|
Krithika Beri wrote:I am getting the following error..
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Main.tables(Main.java:166
Which is line 166? What variable(s) is (are) dereferenced on that line?
|
luck, db
There are no new questions, but there may be new answers.
|
 |
Krithika Beri
Ranch Hand
Joined: Sep 11, 2012
Posts: 36
|
|
is line 166
|
 |
Krithika Beri
Ranch Hand
Joined: Sep 11, 2012
Posts: 36
|
|
Is there a problem with the Object declaration?
|
 |
Krithika Beri
Ranch Hand
Joined: Sep 11, 2012
Posts: 36
|
|
The problem was with object declaration.
I made the following changes for it to work.
|
 |
 |
|
|
subject: Error while trying to create a JTable
|
|
|