Thanks .... I think though the Form designer bootstraps everything in the Constructor, so it will end up calling the VTK components constructor as well ... after the initComponents method ...
On Sun, Sep 8, 2024 at 8:25 PM Eirik Bakke <eba...@ultorg.com> wrote: > You can always just place a JPanel with a BorderLayout in the form > designer, and add the real component to the center of the Jpanel in your > own code right after the call to the generated initComponents() method. > > > > -- Eirik > > > > *From: *Jonathan Bergh <bergh.jonat...@gmail.com> > *Date: *Saturday, September 7, 2024 at 8:26 AM > *To: *NetBeans Mailing List <users@netbeans.apache.org> > *Subject: *Re: Netbeans form designer and static inialisers / VTK > > > > Ok, so as an interim workaround, I have caught the UnsatisfiedLinkError > which is thrown by the Form Designer when loading the VTK panel, and simply > dont inialise any of the VTK specific components if this exception is > thrown. This allows me to continue to work with the base (parent) form in > the designer despite the VTK libraries not being loaded. > > > > So I can design the form but still test everything using the IDE > "run"button ... > > > > On Sat, Sep 7, 2024 at 12:20 PM Jonathan Bergh <bergh.jonat...@gmail.com> > wrote: > > Hi > > I have built a reasonably large app using Netbeans and used the form > designer to do a lot of the heavy lifting and boiler plate which has been > great. > > > > The time has come to integrate the 3D viewer parts, which I "boilerplated" > as a JPanel extension and intended to include this in one of the main app > tabs. It turns out that, because VTK needs a bunch of libraries loaded (I > am using a static block), NB Form designer either breaks or refuses to load > the JPanel because of the exceptions thrown when trying to initialise the > panel. The reasons for the exceptions are because the java.library.path to > the VTK .so's is only set by NB (or the Maven NB executor?) at runtime (ie > when the run button is clicked). > > > > I was wondering whether there was any way around this, 1) I would really > like to continue using the Form designer, as its been such a powerful tool > so far, and 2) whether this is potentially something that could be solved > with a patch to the form design code - ie could it read the command line > args from the Properties tab when its bootstrapping the previews for the > forms, or something like that. I dont know the NB code base well enough to > make a very educated suggestion here, except to highlight the problem (that > the -Djava.library.path=pathToVTKInstall) set in the Project Properties is > only read by Netbeans when the app is run. > > > > Thanks a lot > > Cheers > > /Jon > >