为 Swing/AWT 创建自定义设备进行绘制
我正在开发一个嵌入式 Linux 设备,需要自定义 java 代码才能绘制到屏幕上。我想知道是否有任何方法可以创建一个自定义适配器,可以根据我们的绘图代码更新显示。我做了一些挖掘,但没有找到任何有关如何实现设备或将设备插入 Swing/AWT 的信息。非常感谢任何信息。
谢谢。
I am working on an embedded linux device that requires custom java code to draw to the screen. I was wondering if there was any way to create a custom adapter that can update the display based off our drawing code. I have done some digging and haven't found any information as to how Devices are implemented or plugged into Swing/AWT. Any information is greatly appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您需要超越 Swing/AWT 通常所说的适配器,并使用 JNI(Java 本机接口)自行创建与图形设备的桥接。看一下这个 wiki 页面,它描述了 Javas AWT 层的 JNI 方面 - 有链接在该页面中查看 JNI 和 Swing 这是相当低级的。希望这会让您走上正轨。
I think you need to go beyond what Swing/AWT would typically call an adapter and create the bridge yourself to the graphics device using JNI (Java Native Interface). Have a look at this wiki page which describes the JNI aspects of Javas AWT layer - there are links in that page to details of JNI and Swing which are fairly low-level. Hopefully this will put you on the right track.