Orson Chart Beans
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Orson Chart Beans
Someone at Sun convinced me to have a go at creating a set of chart beans based on JFreeChart, and the result of my initial experimentation is now available to download. Please see:
http://www.jfree.org/orson/
There's still more work to be done to make these "beans" genuinely useful, but I think "Orson 0.5.0" is a good starting point. Feedback is welcome.
http://www.jfree.org/orson/
There's still more work to be done to make these "beans" genuinely useful, but I think "Orson 0.5.0" is a good starting point. Feedback is welcome.
Last edited by david.gilbert on Thu May 22, 2008 9:31 pm, edited 1 time in total.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Problem with Netbeans 5.5
I get error like "Cannot load component class XXX.class. You need to compile the files and set them on classpath".
Murtuza
Murtuza
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Can you post the exact error, along with some details of the JavaBeans environment you are using (NetBeans or something else, version number etc)?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Using on netbeans 5.5
I am using Netbeans 5.5 on Windows XP Platform with JDK1.5
Its a dialog box popup. Where do i check for detailed exception. There is no button on the dialog to show exception.
Murtuza
Its a dialog box popup. Where do i check for detailed exception. There is no button on the dialog to show exception.
Murtuza
Exception Log
Cannot load component class org.jfree.beans.JAreaChart from JAR file: C:\D Drive\Java\JFreeChart\orson-0.5.0.jar.
The class must be compiled and must be on the classpath of the project this form belongs to.Warning: use of system property netbeans.debug.exceptions in org.netbeans.modules.form.BeanSupport has been obsoleted in favor of ErrorManager
java.lang.NullPointerException
at org.netbeans.modules.form.BeanSupport.createBeanInstance(BeanSupport.java:66)
at org.netbeans.modules.form.BeanSupport.getDefaultInstance(BeanSupport.java:83)
at org.netbeans.modules.form.MetaComponentCreator$4.run(MetaComponentCreator.java:1192)
at org.netbeans.modules.form.FormLAF$1.run(FormLAF.java:183)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1201)
at org.openide.util.Mutex.readAccess(Mutex.java:262)
at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:168)
at org.netbeans.modules.form.MetaComponentCreator.prepareClass(MetaComponentCreator.java:1185)
at org.netbeans.modules.form.MetaComponentCreator.precreateVisualComponent(MetaComponentCreator.java:176)
at org.netbeans.modules.form.HandleLayer$NewComponentDrag.init(HandleLayer.java:2573)
at org.netbeans.modules.form.HandleLayer$NewComponentDrag.<init>(HandleLayer.java:2569)
at org.netbeans.modules.form.HandleLayer.mouseMoved(HandleLayer.java:1667)
at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:271)
at java.awt.Component.processMouseMotionEvent(Component.java:5533)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3144)
at java.awt.Component.processEvent(Component.java:5257)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3905)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
The class must be compiled and must be on the classpath of the project this form belongs to.Warning: use of system property netbeans.debug.exceptions in org.netbeans.modules.form.BeanSupport has been obsoleted in favor of ErrorManager
java.lang.NullPointerException
at org.netbeans.modules.form.BeanSupport.createBeanInstance(BeanSupport.java:66)
at org.netbeans.modules.form.BeanSupport.getDefaultInstance(BeanSupport.java:83)
at org.netbeans.modules.form.MetaComponentCreator$4.run(MetaComponentCreator.java:1192)
at org.netbeans.modules.form.FormLAF$1.run(FormLAF.java:183)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1201)
at org.openide.util.Mutex.readAccess(Mutex.java:262)
at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:168)
at org.netbeans.modules.form.MetaComponentCreator.prepareClass(MetaComponentCreator.java:1185)
at org.netbeans.modules.form.MetaComponentCreator.precreateVisualComponent(MetaComponentCreator.java:176)
at org.netbeans.modules.form.HandleLayer$NewComponentDrag.init(HandleLayer.java:2573)
at org.netbeans.modules.form.HandleLayer$NewComponentDrag.<init>(HandleLayer.java:2569)
at org.netbeans.modules.form.HandleLayer.mouseMoved(HandleLayer.java:1667)
at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:271)
at java.awt.Component.processMouseMotionEvent(Component.java:5533)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3144)
at java.awt.Component.processEvent(Component.java:5257)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3905)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Exception Log
Thanks for the details. I'll have a go at reproducing this.
Just a quick thought...
Just a quick thought...
I don't usually work on Windows, but does Java handle the space in the directory path OK?murtuza52 wrote:Cannot load component class org.jfree.beans.JAreaChart from JAR file: C:\D Drive\Java\JFreeChart\orson-0.5.0.jar.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Just to reconfirm, i changed the directory of the library and here is the same exception again. No problems with other components i am using.
Code: Select all
Annotation: Cannot load component class org.jfree.beans.JAreaChart from JAR file: D:\Java\JFreeChart\orson-0.5.0\orson-0.5.0.jar.
The class must be compiled and must be on the classpath of the project this form belongs to.
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
at org.netbeans.modules.form.project.ProjectClassLoader.findClass(ProjectClassLoader.java:113)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.netbeans.modules.form.project.FormClassLoader.findClass(FormClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.netbeans.modules.form.project.ClassPathUtils.loadClass(ClassPathUtils.java:65)
[catch] at org.netbeans.modules.form.MetaComponentCreator.prepareClass0(MetaComponentCreator.java:1242)
at org.netbeans.modules.form.MetaComponentCreator.access$400(MetaComponentCreator.java:53)
at org.netbeans.modules.form.MetaComponentCreator$4.run(MetaComponentCreator.java:1215)
at org.netbeans.modules.form.FormLAF$1.run(FormLAF.java:150)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1178)
at org.openide.util.Mutex.readAccess(Mutex.java:259)
at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:135)
at org.netbeans.modules.form.MetaComponentCreator.prepareClass(MetaComponentCreator.java:1210)
at org.netbeans.modules.form.MetaComponentCreator.precreateVisualComponent(MetaComponentCreator.java:156)
at org.netbeans.modules.form.HandleLayer$NewComponentDrag.init(HandleLayer.java:2498)
at org.netbeans.modules.form.HandleLayer$NewComponentDrag.<init>(HandleLayer.java:2494)
at org.netbeans.modules.form.HandleLayer.mouseMoved(HandleLayer.java:1636)
at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:271)
at java.awt.Component.processMouseMotionEvent(Component.java:5533)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3144)
at java.awt.Component.processEvent(Component.java:5257)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3905)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Warning: use of system property netbeans.debug.exceptions in org.netbeans.modules.form.BeanSupport has been obsoleted in favor of ErrorManager
java.lang.NullPointerException
at org.netbeans.modules.form.BeanSupport.createBeanInstance(BeanSupport.java:66)
at org.netbeans.modules.form.BeanSupport.getDefaultInstance(BeanSupport.java:97)
at org.netbeans.modules.form.MetaComponentCreator$4.run(MetaComponentCreator.java:1217)
at org.netbeans.modules.form.FormLAF$1.run(FormLAF.java:150)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1178)
at org.openide.util.Mutex.readAccess(Mutex.java:259)
at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:135)
at org.netbeans.modules.form.MetaComponentCreator.prepareClass(MetaComponentCreator.java:1210)
at org.netbeans.modules.form.MetaComponentCreator.precreateVisualComponent(MetaComponentCreator.java:156)
at org.netbeans.modules.form.HandleLayer$NewComponentDrag.init(HandleLayer.java:2498)
at org.netbeans.modules.form.HandleLayer$NewComponentDrag.<init>(HandleLayer.java:2494)
at org.netbeans.modules.form.HandleLayer.mouseMoved(HandleLayer.java:1636)
at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:271)
at java.awt.Component.processMouseMotionEvent(Component.java:5533)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3144)
at java.awt.Component.processEvent(Component.java:5257)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3905)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
I had the same error and fixed it with a rebuild of orson.
It is posible to move the 'jLineChartBeanInfo' into a Form but i can't embed it in a JFrame or JPanel. So it is not fully loaded i guess.
When i open the properties all de values display 'object is not an instance of declaring class' of een 'java.lang.ClassCastException@<garbage>'.
Someone?
edit:
With some playing with the Post-Init code i've succeed to add a ChartPanel. But this solution works around the native GUI designer of course. Just set the Layout on null in the designer and add your own code to add the ChartPanel.
It is posible to move the 'jLineChartBeanInfo' into a Form but i can't embed it in a JFrame or JPanel. So it is not fully loaded i guess.
When i open the properties all de values display 'object is not an instance of declaring class' of een 'java.lang.ClassCastException@<garbage>'.
Someone?
edit:
With some playing with the Post-Init code i've succeed to add a ChartPanel. But this solution works around the native GUI designer of course. Just set the Layout on null in the designer and add your own code to add the ChartPanel.
Rebuilding Orson 0.5.0 in Netbeans 5.5
Initially I got the error
"I get error like "Cannot load component class XXX.class. You need to compile the files and set them on classpath"."
Simply putting the JAR files on my classpath proved to be no avail. Rebuilding orson seemed to be the solution. Howto for netbeans 5.5:
Rebuilding Orson 0.5.0 in Netbeans 5.5
1) From menu: File - New Project - select: Java Project with existing Ant Script - (Next)
2) Location - Select the "orson-0.5.0" folder that contains the ant, etc folders.
3) Build Script - Select from the "orson-0.5.0\ant" folder the build.xml file
4) Continue the wizzard until the end. (Next^n). You don't need to set it as your main project however.
5) Right click on the Orson Project and select "Build Project".
Turn Orson in a Library
1) From Menu: Tools - Library Manager - Select: "New Library" (Orson)
2) Add the freshly build jar file from the Orson project folder. (Ok)
3) (Optional) Add the source and javadoc folder as well. (Ok)
Adding Orson to your beans pallete using a library
1) From menu: Tools - Pallete Manager - Swing/AWT Components.
2) Select "Add from Library" - select the Orson library - click ok - add it to a category (the beans if you don't want to mess up the other pallets).
Note: As giorgio42 points out make sure that you have to add the JFreeChart libraries to whatever project you want to use the beans with. This files are actually included with the Orson 0.5.0 download and can be found in the lib folder.
Everything should work like a charm now - this has been tested under Windows XP running JDK 1.5 using Netbeans 5.5. Should be the same procedure under Linux or Mac though.
Let me know if anyone has any problems.
"I get error like "Cannot load component class XXX.class. You need to compile the files and set them on classpath"."
Simply putting the JAR files on my classpath proved to be no avail. Rebuilding orson seemed to be the solution. Howto for netbeans 5.5:
Rebuilding Orson 0.5.0 in Netbeans 5.5
1) From menu: File - New Project - select: Java Project with existing Ant Script - (Next)
2) Location - Select the "orson-0.5.0" folder that contains the ant, etc folders.
3) Build Script - Select from the "orson-0.5.0\ant" folder the build.xml file
4) Continue the wizzard until the end. (Next^n). You don't need to set it as your main project however.
5) Right click on the Orson Project and select "Build Project".
Turn Orson in a Library
1) From Menu: Tools - Library Manager - Select: "New Library" (Orson)
2) Add the freshly build jar file from the Orson project folder. (Ok)
3) (Optional) Add the source and javadoc folder as well. (Ok)
Adding Orson to your beans pallete using a library
1) From menu: Tools - Pallete Manager - Swing/AWT Components.
2) Select "Add from Library" - select the Orson library - click ok - add it to a category (the beans if you don't want to mess up the other pallets).
Note: As giorgio42 points out make sure that you have to add the JFreeChart libraries to whatever project you want to use the beans with. This files are actually included with the Orson 0.5.0 download and can be found in the lib folder.
Everything should work like a charm now - this has been tested under Windows XP running JDK 1.5 using Netbeans 5.5. Should be the same procedure under Linux or Mac though.
Let me know if anyone has any problems.
Netbeans 6.0
That's odd since giorgio42 claims it worked with NB 6.0 (see above). Perhaps the both of you can specify exactly what steps you took and see where your methods differ.
How can I insert ChartPanel in JFrame?
Orson have no such a bean. But it is not cool to use the charts without ChartPanel.
So is it an intentional solution or just a consequence of not completed state?
Thank you.
So is it an intentional solution or just a consequence of not completed state?
Thank you.