Glad to hear it. FYI, you can probably drop the "getClassLoader()" since I
believe Class#getResource() will delegate to that.
On May 16, 2011, at 4:48 PM, Wim Goeman wrote:
> Hi Greg,
>
> Yet again you helped me out. Just for the record, since my bxml file (as well
> as my icon) is on my classpath, I passed
> "getClass().getClassLoader().getResource("mylayout.bxml")" to the readObject
> method. This worked as expected.
>
> Thanks a lot!
>
> Wim
>
> 2011/5/13 Greg Brown <[email protected]>
> > Setting the icon using the xml file is still giving issues:
> > "java.lang.IllegalStateException: Base location is undefined."
>
> You need to load the BXML using one of the readObject() overloads that takes
> a URL so the serializer knows what the filename is relative to.
>
> > Using a png file did the trick in the code, so that is good news. I can
> > live with that, but I was just wondering if there is a possibility to set a
> > different icon for a different resolution. I would like the icon to look as
> > good in a dock as it looks in a task bar.
>
> You can set multiple icons on a window by calling window.getIcons().add().
> These will be passed to the native host frame, which should select the most
> appropriate resolution.
>
> G
>
>
>