You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am using XChartPanel<XYChart> to display a chart using its paint() method. This panel is put in a frame. However, when the frame width becomes too small (for instance by using the mouse to decrease the frame width), a NullPointerException will occur repeateadly.
Here is the exception:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.knowm.xchart.internal.chartpart.PlotContent_XY.doPaint(PlotContent_XY.java:308)
at org.knowm.xchart.internal.chartpart.PlotContent_.paint(PlotContent_.java:62)
at org.knowm.xchart.internal.chartpart.Plot_.paint(Plot_.java:38)
at org.knowm.xchart.internal.chartpart.Plot_AxesChart.paint(Plot_AxesChart.java:35)
at org.knowm.xchart.XYChart.paint(XYChart.java:417)
at org.knowm.xchart.XChartPanel.paintComponent(XChartPanel.java:168)
at javax.swing.JComponent.paint(JComponent.java:1056)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5217)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
at javax.swing.JComponent.paint(JComponent.java:1042)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:79)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:116)
at java.awt.Container.paint(Container.java:1978)
at java.awt.Window.paint(Window.java:3906)
at javax.swing.RepaintManager$4.run(RepaintManager.java:842)
at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
The min width at which the exception triggers depends on the amount of axis group which are displayed. The more axis group there are, the higher the min width is.
I tested version 3.6.4, 3.6.6 and the latest 3.8.2. This bug appears on all 3 versions.
The text was updated successfully, but these errors were encountered:
I put this code in place a long time ago to prevent this exact thing from happening. I wonder if I need to increase the 30 to 40 or handle it in a better way. Any suggestions?
Hi,
I am using
XChartPanel<XYChart>
to display a chart using itspaint()
method. This panel is put in a frame. However, when the frame width becomes too small (for instance by using the mouse to decrease the frame width), a NullPointerException will occur repeateadly.Here is the exception:
The min width at which the exception triggers depends on the amount of axis group which are displayed. The more axis group there are, the higher the min width is.
I tested version 3.6.4, 3.6.6 and the latest 3.8.2. This bug appears on all 3 versions.
The text was updated successfully, but these errors were encountered: