将Gui和Processing结合起来
问题描述:
我正在尝试在WindowBuilder Gui中添加一个Processing项目。几种不同的尝试后,我抬头一看,发现这一点:将Gui和Processing结合起来
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method add(Component) in the type Container is not applicable for the arguments (PApplet)
The method init() is undefined for the type PApplet
at processJava.DisplayFrame.<init>(DisplayFrame.java:9)
at processJava.Main.main(Main.java:5)
如何解决这两个:
完全相同创建相同的项目,我必须还存在一些错误后?
答
从处理3起,PApplet
不再延伸Applet
,所以它不能用作另一个gui中的组件。
您可以使用runSketch()
函数从Java启动草图,但该函数将位于其自己的单独窗口中。
你有没有想过这个想法? –