java.awt.FileDialog does not work properly bundled but not sandboxed app

Steve Hannah steve at weblite.ca
Fri May 30 16:49:34 UTC 2014


For my OS X apps, I generally use a wrapper of NSOpenPanel and NSSavePanel
that I created rather than java.awt.FileDialog.  That way I have access to
the full gamut of what Cocoa provides in file dialogs.  It also won't be
affected by this bug.
I have posted the source and some example usage here.
https://gist.github.com/shannah/65007754c2b0f8add4f7

Feel free to use it.

Steve


On Fri, May 30, 2014 at 12:33 AM, Robert Krüger <krueger at lesspain.de> wrote:

> On Thu, May 29, 2014 at 10:39 PM, Hendrik Schreiber <hs at tagtraum.com>
> wrote:
> > On May 29, 2014, at 12:27, Robert Krüger <krueger at lesspain.de> wrote:
> >
> >> I am not really sure I understand your posting correctly. Are you
> >> saying that your impression is that java.awt.FileDialog in mode
> >> FileDialog.LOAD does not work properly in an app bundle, regardless of
> >> sandboxing? If that is so, then I can confirm that this is not the
> >> case.
> >>
> >> You are not by any chance starting the app with a splash screen with
> >> -splash? If so that is likely to be the reason for your problems as
> >> java.awt.FileDialog is completely broken then (see
> >> https://bugs.openjdk.java.net/browse/JDK-8009203,
> >> https://bugs.openjdk.java.net/browse/JDK-8006420). If I understand the
> >> feedback of an Oracle dev a few days ago on this list correctly, this
> >> is fixed in J9 and will be backported for the next J8 update. We even
> >> implemented our own splash screen because of this.
> >
> > Thank you, Robert for pointing out the (not quite so obvious) connection
> between the FileDialog and the splash screen.
> > Indeed, I was attempting to use the splash screen option.. once I
> removed it, things were working as expected.
>
> I know the feeling :-). I ran into this a few months ago and didn't
> have a clue what was causing it until a colleague of mine somehow
> stumbled over another bug (full-screen mode screwed up by splash
> screen, I think) with a similar non-obvious connection.
>
> Cheers,
>
> Robert
>



-- 
Steve Hannah
Web Lite Solutions Corp.


More information about the macosx-port-dev mailing list