Re: Write to to resources location from another module
Mark Wade <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <[email protected]> |
Hmm., guess I should have thought a bit before I blurted, I'm real rusty
on all this, I can't write to resources, there in jars, yes? I'll need
to go about this differently I think, create the images differently,
maybe ImageUtilities is not what I should use.
If anyone does have any insight, however, what I'm trying to do is:
I'm building an item in an inventory program from tables in a relational
DB and one of the fields is a file name, ie foo.jpg. The images are
stored in the OS's file system rather than in the DB as a blob or such,
I just thought that was better, I know the path, I just need the file
name from the DB. I've been entering this field using the DB's interface
but I'm now trying to implement the functionality pragmatically. Rather
than a wizard I implemented a custom dialog with DialogDescriptor that
allows manual entry of the path(well, not yet) and a browse button that
opens a JFileChooser. That selected file I then copy to a known location
and then I have problems using ImageUtilities.
Sorry to be so long-winded and thanks for the bandwidth,
Mark Wade
On 06/03/2016 04:23 PM, Mark Wade wrote:
> Hello,
>
> I'm loading images using ImageUtilities.loadImage(String resourceID)
> in a viewer module. In a separate editor module I'm trying to use a
> filechooser dialog that can be used to select an image file which
> would then be copied to that resource location. I tried to use
> System.getProperty("user.dir") but that is not a resource and so
> returns null.
>
> Can I get that particular module's class loader and get a path to that
> resource location so that I can write an image file to it from outside
> that module?
>
> -- Mark Wade
>
>