Board index » jbuilder » jdbTable renderer error

jdbTable renderer error


2004-02-18 02:13:16 AM
jbuilder23
I have an application which connects to another application.
Each time it receive update from another application (the
frequency of the update is about once every 2 seconds),
it will save the data to database, then refresh the dataset
which is linked with a JdbTable. Sometimes I got the following
error. But it is random, and the error message shows nothing
wrong in my codes. Totally no clue! I am desperate for help.
java.lang.NullPointerException
at com.borland.dbswing.JdbTable.prepareRenderer(JdbTable.java:1917)
at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149)
at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
at javax.swing.JComponent.paintComponent(JComponent.java:541)
at javax.swing.JComponent.paint(JComponent.java:808)
at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4771)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)
at javax.swing.JComponent._paintImmediately(JComponent.java:4668)
at javax.swing.JComponent.paintImmediately(JComponent.java:4477)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
 
 

Re:jdbTable renderer error

Hi,
I have an application which connects to another application.
Each time it receive update from another application (the
frequency of the update is about once every 2 seconds),
it will save the data to database, then refresh the dataset
which is linked with a JdbTable. Sometimes I got the following
error. But it is random, and the error message shows nothing
wrong in my codes. Totally no clue! I am desperate for help.
java.lang.NullPointerException
at com.borland.dbswing.JdbTable.prepareRenderer(JdbTable.java:1917)
at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149)
at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
at javax.swing.JComponent.paintComponent(JComponent.java:541)
at javax.swing.JComponent.paint(JComponent.java:808)
at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4771)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)
at javax.swing.JComponent._paintImmediately(JComponent.java:4668)
at javax.swing.JComponent.paintImmediately(JComponent.java:4477)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
L.G.
 

Re:jdbTable renderer error

L.G. wrote:
Quote

Hi,

I have an application which connects to another application.
Each time it receive update from another application (the
frequency of the update is about once every 2 seconds),
it will save the data to database, then refresh the dataset
which is linked with a JdbTable. Sometimes I got the following
error. But it is random, and the error message shows nothing
wrong in my codes. Totally no clue! I am desperate for help.

Sounds as though the Table is not being refreshed properly, or has been
randomly closed during the operation. Try putting something like this in
your code
if(myQueryDataSet.isOpen()==false) {
myQueryDataSet.open();
}
Also, you might try updating the UI on the JdbTable itself:
myJdbtable.updateUI();
or
myJdbTable.repaint();
or
if(myJdbTable.getDataSet()==null) {
JOptiopnPane.showMessageDialog(this,"The table Dataset is null.");
}
If the latter is the case then
if (myJdbTable.getDataSet().isOpen()==false) {
myJdbTable.getDataSet().open();
}
 

{smallsort}

Re:jdbTable renderer error

Hi,
I'm experiencing something similar after upgrading to dbSwing.jar & JDK
1.4 (from dbSwing3.0.jar & JDK 1.3).
The exception is *sometimes* thrown when I refresh a table, the
resulting stack trace (see below) get doesn't list any of my code.
Many thanks in advance for any suggestions.
Best Wishes,
Don
java.lang.NullPointerException at
com.borland.dbswing.JdbTable.prepareRenderer(JdbTable.java:1920) at
javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149) at
javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051) at
javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974) at
javax.swing.plaf.ComponentUI.update(ComponentUI.java:142) at
javax.swing.JComponent.paintComponent(JComponent.java:541) at
javax.swing.JComponent.paint(JComponent.java:808) at
javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4795) at
javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4748) at
javax.swing.JComponent._paintImmediately(JComponent.java:4692) at
javax.swing.JComponent.paintImmediately(JComponent.java:4495) at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410) at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117) at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178) at
java.awt.EventQueue.dispatchEvent(EventQueue.java:454) at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201) at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145) at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137) at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Quote
Sounds as though the Table is not being refreshed properly, or has
been
randomly closed during the operation. Try putting something like this
in
your code

if(myQueryDataSet.isOpen()==false) {
myQueryDataSet.open();
}

Also, you might try updating the UI on the JdbTable itself:

myJdbtable.updateUI();
or
myJdbTable.repaint();

or
if(myJdbTable.getDataSet()==null) {
JOptiopnPane.showMessageDialog(this,"The table Dataset is
null.");
}

If the latter is the case then
if (myJdbTable.getDataSet().isOpen()==false) {
myJdbTable.getDataSet().open();
}