是否有可能使用Jzy3D在一个NetBeans 7.0的应用程序?有可能、应用程序、NetBeans、Jzy3D

2023-09-07 23:52:49 作者:娜些时光,永不杰束

好了,所以我们试图将一个3D散点图到我们的项目在Netbeans的7.0,我们选择的测试库之一是Jzy3D。它看起来喜欢它会做我们需要它的一切,但不幸的是,它没有做任何事情。

Alright, so we're trying to incorporate a 3D scatterplot into our project in Netbeans 7.0, and one of the libraries we chose to test was Jzy3D. It looks likes it would do everything we needed it to, but unfortunately, it's not doing anything.

我已经安装JOGL正确,并对其进行了测试,发现它是工作。然后,我已经包含了相同的依赖关系的演示。我也试过直接包括.jar文件。是的,gluegen-rt.jar中的在库文件夹。

I have JOGL installed properly, and have tested it and found it to be working. Then I have included the same dependencies as in the demo. I have also tried directly including the .jars. And yes, gluegen-rt.jar is in the library folder.

编辑::要获得JOGL工作,我们不得不大量修改构建设置。说实话,我的老板做了大部分,所以我不完全知道如何复制它。现在,我试图把图表中的一个JFrame,而FrameSwing扩展从Jzy3D库提供了以下错误:

To get JOGL working, we had to heavily modify build settings. Honestly, my boss did most of it, so I'm not entirely sure how to replicate it yet. Now, I'm trying to put a chart in a JFrame, and the FrameSwing extension from the Jzy3D library is giving the following error:

Exception in thread "main" java.lang.ClassCastException: org.jzy3d.plot3d.rendering.canvas.CanvasAWT cannot be cast to javax.swing.JComponent
    at org.jzy3d.bridge.swing.FrameSwing.(FrameSwing.java:36)
    at scratchwork.My3DChart.main(My3DChart.java:40)

我会继续在它的工作,但如果有人知道什么是错的,这将是很好知道。

I'll keep working at it, but if someone knows what's wrong, it would be nice to know.

更新:看来,CanvasAWT从画布这是从组件,而不是JComponent的扩展延伸。这似乎是这个问题,我已经提交给了Jzy3D作者。

Update: It appears that CanvasAWT is extended from Canvas which is extended from Component, not JComponent. This seems to be the problem, and I've submitted it to the Jzy3D authors.

推荐答案

也许你忘了创建使用构造函数中的摇摆选项的图表作为陈述的有的。它有一个CanvasSwing这是一个JComponent预期在一个Swing应用程序创建的图表。构建摆动图表创建一个JOGL lightwight组分,可以与其它JComponent上出现在顶部被混合(默认AWT图表是heavywight并保持任何其他UI组件的顶部)。

Maybe you forgot to create the chart using the "swing" option in the constructor as stated there. It creates the chart with a CanvasSwing which is a JComponent as expected in a Swing app. Building a swing chart creates a JOGL lightwight component that can be mixed with other JComponents appearing on top (the default AWT chart is heavywight and remains on top of any other UI component).

Jzy3d已经在与其他窗口化工具包无论是在摇摆成功,所以它应该为你工作。

Jzy3d has already been working with success both in Swing and other Windowing toolkits, so it should work for you.

干杯,

马丁