如何在其他处理选项卡中使用public class bye .java文件? [英] How to use public class frome .java file in other processing tabs?
问题描述
我的问题似乎微不足道,但在2小时的Google搜索后,我没有任何东西。我有Processing sketch。第一个主标签包含:
My problem seems to be trivial, but after 2 hours of googling I came with nothing. I have Processing sketch. The first, main tab contains:
Foo bar;
void setup() {
}
void draw() {
}
第二个是Foo.java文件:
The second is Foo.java file:
package processing.core;
import java.io.Serializable;
import processing.core.PApplet;
public class Foo implements Serializable {
}
尝试运行这个程序我在第一个文件的第一行:
After I try to run this program I get at the first line of the first file:
Cannot find a class or type "Foo"
第二个文件是Foo.java,第一个有一些随机名称,甚至不是simmilar,冲突。
The second file is Foo.java, the first has some random name, not even simmilar, so it's not a conflict. And the file is in the same directory as the main pde file.
我在处理IDE 。
我该怎么做,使.java文件类可见?是的 - 我需要.java文件,因为我需要使用一些更复杂的.java文件...
What should I do to make the .java file class visible? And yes - I need .java file, since I need to use some much more complicated .java file...
提前感谢!
推荐答案
好吧,在询问processing.org论坛后,一个人显示我的代码,这是工作,比较后,我发现,
Ok, after asking on processing.org forum one guy showed me code, which works, and after comparing them I found, that I have pointless line:
package processing.core;
哪些原因造成问题!
正确的代码:
something.pde:
something.pde:
Foo bar;
void setup() {
}
void draw() {
}
Foo.java:
import java.io.Serializable;
import processing.core.PApplet;
public class Foo implements Serializable {
}
http://forum.processing.org/two/discussion/comment/12111#Comment_12111 < a>
http://forum.processing.org/two/discussion/comment/12111#Comment_12111
:)不过 - 谢谢你们的帮助!
:) However - thank you both for help!
这篇关于如何在其他处理选项卡中使用public class bye .java文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!