[英]How to make PDE file in Netbeans
I have a Java GUI project in netbeans
and I want to make Processing Development Environment (PDE) file of it. 我在
netbeans
有一个Java GUI项目,我想为其制作处理开发环境(PDE)文件。 I have searched everywhere but couldn't find the solution. 我到处搜索,但找不到解决方案。 Please help.
请帮忙。
A .pde
file is really just a text file with a .pde
extension. .pde
文件实际上只是一个扩展名为.pde
的文本文件。 You can prove this by opening up a .pde
file in a basic text editor like notepad or JEdit. 您可以通过在基本文本编辑器(如记事本或
.pde
打开.pde
文件来证明这一点。
So to create a .pde
file, you just have to print some Processing code to a text file and give it a name that ends with .pde
. 因此,要创建一个
.pde
文件,只需将一些处理代码打印到一个文本文件中,并为其指定一个以.pde
结尾的名称。
If you have file associations set up (which happens automatically when you install Processing), then the Processing editor will open .pde
files be default. 如果您设置了文件关联(在安装Processing时会自动发生),则Processing编辑器将默认打开
.pde
文件。
The Processing editor expects .pde
files to be in a folder with the same name as the .pde
file, but I think it will actually detect this and move it for you, so that might not be strictly necessary. 处理编辑器期望
.pde
文件位于与.pde
文件.pde
文件夹中,但是我认为它实际上会检测到该错误并为您移动它,因此可能并非绝对必要。
Edit: But I wonder if that's what you're actually asking. 编辑:但是我想知道这是否是您真正要问的。 If what you're actually asking is how to use Processing as a Java library in Netbeans, then that's a different question.
如果您实际上要问的是如何在Netbeans中将Processing用作Java库,那么这是一个不同的问题。
If that is what you're asking, then you're no longer using a .pde
file. 如果这是您的要求,那么您将不再使用
.pde
文件。 Instead, you'll need to create a Java project, then add the Processing library jars (located in the Processing directory) to your classpath. 相反,您需要创建一个Java项目,然后将Processing库jar(位于Processing目录中)添加到类路径中。 After that you can call Processing from Java, and most projects will start with a class that extends
PApplet
. 之后,您可以从Java调用Processing,大多数项目将从扩展
PApplet
的类开始。 That class contains your sketch code, and you launch it by calling PApplet.main("YourSketchNameHere");
该类包含您的草图代码,然后通过调用
PApplet.main("YourSketchNameHere");
启动它PApplet.main("YourSketchNameHere");
from the regular main()
method. 来自常规的
main()
方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.