JP:

Thanks for the additional information.  I've seen some indication that the
Felix team are considering how to handle the JavaFX issues as well.
Perhaps it is time to investigate Karaf further -- but it adds a lot of
additional capabilities that a client doesn't actually need if I understand
correctly.   When I get back to programming I'll have to investigate
further the options offered by Karaf.  Right now I'm concentrating on
getting my knee replacement to respond to therapy.  Narcotics make me feel
and act loopy so best I absent myself for a while.  But I suspect I'm not
the only one interested in this subject and I suppose others will chime in
as time passes.

On Thu, Jul 20, 2017 at 5:25 AM, CLEMENT Jean-Philippe <
jean-philippe.clem...@fr.thalesgroup.com> wrote:

> Ok, thanks.
>
> At least with Karaf, there is no such "ClassNotFoundException"  (JavaFX
> packages must declared in the jre.properties file). I don't use things
> explained in Paul's article.
>
> I just need the initialize() of the class below to be called within a
> singleton bundle. That bundle should be started before any other which uses
> JavaFX. Then there is no more "primary window" and any bundle can show
> whatever things it needs.
>
> public final class FXInitializer extends Application {
>     private static BlockingQueue<FXInitializer> sync;
>
>     /**
>      * Initializes the FX windowing system.
>      *
>      * @throws InterruptedException
>      *             If initialization was cancelled due to program exit
>      */
>     public static FXInitializer initialize() throws InterruptedException {
>         return initialize(new String[0]);
>     }
>
>     /**
>      * Initializes the FX windowing system.
>      *
>      * @param a
>      *            Arguments as gave to the "main" application
>      * @throws InterruptedException
>      *             If initialization was cancelled due to program exit
>      */
>     public static FXInitializer initialize(final String... a) throws
> InterruptedException {
>         try {
>             Platform.setImplicitExit(false);
>             sync = new SynchronousQueue<>();
>             new Thread(() -> FXInitializer.launch(FXInitializer.class,
> a)).start();
>             return sync.take();
>         } finally {
>             sync = null;
>         }
>     }
>
>     @Override
>     public void start(final Stage stage) throws InterruptedException {
>         stage.hide();
>         sync.put(this);
>     }
> }
>
> JP
>
>
>
>

Reply via email to