Cast jzy3d.canvas to awt.component

痞子三分冷 提交于 2019-12-02 11:57:26

This working for me. Easy solution, when I give jzy3d canvas to my canvas and put it into panel.

Chart chart = AWTChartComponentFactory.chart(Quality.Advanced, IChartComponentFactory.Toolkit.swing);   
ChartScene scene = chart.getScene();
AWTCameraMouseController controller = new AWTCameraMouseController(chart);
Component canvas = (Component) chart.getCanvas();
canvas.addMouseListener(controller);
canvas.addMouseMotionListener(controller);
canvas.addMouseWheelListener(controller);
centerPanel.add(canvas, BorderLayout.CENTER);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!