We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello
I´m working on a big project in eclipse with the processing.core.* library.
And at the moment I have some problems with organizing the resources.
should I put them into a recource folder or into a package in src?
How can I access the resources?
at the moment, I´m using
app.getClass().getClassLoader().getResource("data");
and
app.sketchPath("data")
but when i export everything into a runnable jar file, it isn´t working caused by the resources.
can someone help?
Comments
I don't know if that's a good way to do it, but in my Java projects, I have a
resource
folder at the same level than thesrc
folder, with same package structure.If a class needs to load a specific resource, I put it in the same package than the class, in the
resource
folder, of course.Then, I just use my ResourceUtil class to get its path...
it is working
I´m saving the resources in a resource folder called
res
in a package calleddata
.With this method, I´m creating the path for every file:
The String
path
starts with "data/"Because I´m using G4P, I had to change the
loadStyle_FromSketch
method in GCustomSlider in the G4P library: