2016-11-06 112 views
-1

我正在嘗試在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) 

如何解決這兩個:

http://www.sebastianoliva.com/en/en/2010/05/using-a-processing-sketch-as-a-java-component/trackback/index.html

完全相同創建相同的項目,我必須還存在一些錯誤後?

+0

你有沒有想過這個想法? –

回答

0

從處理3起,PApplet不再延伸Applet,所以它不能用作另一個gui中的組件。

您可以使用runSketch()函數從Java啓動草圖,但該函數將位於其自己的單獨窗口中。