如何使C ++代码绘制Java组件 [英] How to make C++ code draw on Java components

查看:110
本文介绍了如何使C ++代码绘制Java组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在设计物理应用程序,我们希望使用Java编写,我们还希望使用(根是C ++中的writen)。 Root有一些不错的图形功能 - 它能绘制非常好的3D图表,我想是否可以嵌入这些图表在Java应用程序。

We are designing physics app, and we would like to have it written in Java, and also we want to use root (root is writen in C++). Root has some nice graphical features -- it is able to draw very nice 3D charts, and I'm thinking whether it's possible to embedd those charts in Java app.

有没有办法使C ++代码绘制在例如 JPanel

Is there any way to make C++ code draw on for example JPanel?

有没有办法传回鼠标/键盘事件? - 我们希望有一些交互性,如旋转一个三维图表。

Is there a way to pass back mouse/keyboard events? - we would like to have some interactivity, like rotating a 3d chart.

我问过类似的问题,在Java应用程序(也关于root)中嵌入了大量的C ++代码(与绘图没有任何关系)在此

I asked similar question about embedding a lot of C++ code (that is not related to drawing anything) in Java app (also about root) it's here.

推荐答案

由于SWT是构建为一个相当薄的包装原生小部件,它可能比Swing / AWT为您的特定任务。我实现了此特定链接 a>有点旧,但它显示如何快速包装本机窗口小部件。

Since SWT is built to be a fairly thin wrapper around native widgets, it may be easier to work with than Swing/AWT for your particular task. I realize this particular link is a bit old, but it does show how to quickly wrap a native widget.

这篇关于如何使C ++代码绘制Java组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆