Orson Chart Beans

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Orson Chart Beans

Post by david.gilbert » Wed Jul 04, 2007 5:19 pm

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.
Last edited by david.gilbert on Thu May 22, 2008 9:31 pm, edited 1 time in total.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

eriktamu
Posts: 12
Joined: Thu Nov 11, 2004 11:32 pm
Location: Austin, TX
Contact:

Post by eriktamu » Tue Jul 10, 2007 7:53 pm

This looks great! Thanks for all of your hard work.

murtuza52
Posts: 9
Joined: Tue Aug 23, 2005 1:07 pm

Problem with Netbeans 5.5

Post by murtuza52 » Thu Aug 16, 2007 2:47 pm

I get error like "Cannot load component class XXX.class. You need to compile the files and set them on classpath".

Murtuza

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Aug 16, 2007 4:22 pm

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

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

murtuza52
Posts: 9
Joined: Tue Aug 23, 2005 1:07 pm

Using on netbeans 5.5

Post by murtuza52 » Fri Aug 17, 2007 6:45 am

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

murtuza52
Posts: 9
Joined: Tue Aug 23, 2005 1:07 pm

Exception Log

Post by murtuza52 » Fri Aug 17, 2007 8:27 am

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)

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Exception Log

Post by david.gilbert » Fri Aug 17, 2007 9:57 am

Thanks for the details. I'll have a go at reproducing this.

Just a quick thought...
murtuza52 wrote:Cannot load component class org.jfree.beans.JAreaChart from JAR file: C:\D Drive\Java\JFreeChart\orson-0.5.0.jar.
I don't usually work on Windows, but does Java handle the space in the directory path OK?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

murtuza52
Posts: 9
Joined: Tue Aug 23, 2005 1:07 pm

Post by murtuza52 » Sat Aug 18, 2007 6:55 am

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)


murtuza52
Posts: 9
Joined: Tue Aug 23, 2005 1:07 pm

Post by murtuza52 » Sat Aug 18, 2007 6:56 am

Do you thinks its go to do with jdk version you have compiled i higher than i am using.

Murtuza

LauPro
Posts: 1
Joined: Mon Aug 27, 2007 11:17 pm

Post by LauPro » Mon Aug 27, 2007 11:20 pm

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.

giorgio42
Posts: 9
Joined: Tue Jul 15, 2003 5:44 pm
Location: Munich, Germany

Post by giorgio42 » Wed Aug 29, 2007 10:30 pm

You have to add the JFreeChart libraries to your project's dependencies.

I have tested adding a JLineChart to a JFrame using NB 6.0 successfully.

jsnel
Posts: 19
Joined: Thu Apr 19, 2007 12:00 pm

Rebuilding Orson 0.5.0 in Netbeans 5.5

Post by jsnel » Mon Sep 03, 2007 4:09 pm

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.

giorgio42
Posts: 9
Joined: Tue Jul 15, 2003 5:44 pm
Location: Munich, Germany

Post by giorgio42 » Wed Sep 05, 2007 11:44 pm

Just for your info: I tried the Orson libraries with latest daily builds of NetBeans 6.0, but without success: first an NPE when I drop a JLineChart on a JFrame and then next one when I try to save the form (and I finally cannot save it).

jsnel
Posts: 19
Joined: Thu Apr 19, 2007 12:00 pm

Netbeans 6.0

Post by jsnel » Thu Sep 06, 2007 12:10 am

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.

astrakh
Posts: 1
Joined: Mon Sep 10, 2007 8:15 pm

How can I insert ChartPanel in JFrame?

Post by astrakh » Mon Sep 10, 2007 8:43 pm

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.

Locked