Re: Two minor modeler feature requests

From: Michael Gentry (
Date: Tue Jun 23 2009 - 10:35:58 EDT

  • Next message: Andrus Adamchik: "Re: Two minor modeler feature requests"

    Well, the negative impact is FileDialog doesn't look native (or as
    native--been a while since I tested it) on Windows, but JFileChooser
    does. One thing we want is to try to support Mac and Windows users as
    equally as we can.


    On Tue, Jun 23, 2009 at 10:28 AM, John Armstrong<> wrote:
    > I use java.awt.FileDialog on mac and windows in multiple apps without
    > any negative impacts so we can probably get away without the switch.
    > Its worth a shot and as you point out, the benefits are numerous.
    > java.awt.FileDialog addFileChooser = new FileDialog(this,
    >                                "Choose a file", FileDialog.LOAD);
    >                addFileChooser.setVisible(true);
    >                String fn = addFileChooser.getFile();
    >                String dn = addFileChooser.getDirectory();
    >                if (fn != null)
    >                        System.err.println("You cancelled the choice");
    >                else {
    >                        System.err.println("You chose " + dn + fn);
    >                        File file = new File(dn + fn);
    >                }
    > On Tue, Jun 23, 2009 at 7:18 AM, Michael Gentry<> wrote:
    >> I just checked the Modeler code and it is using Swing's JFileChooser
    >> instead of AWT's FileDialog.  On OS X, the AWT FileDialog is the
    >> "proper" file dialog to use (it is the one Apple mapped to the native
    >> file dialog).  We'd have to change the code to conditionally open
    >> JFileChooser/FileDialog depending on the platform.  I've actually got
    >> some code that already does that (different project), so maybe it
    >> could be added.  The FileDialog also remembers the size of the open
    >> window, the directory you were last in, etc.  Just like you'd expect
    >> it to operate on a Mac.
    >> mrg
    >> On Tue, Jun 23, 2009 at 10:08 AM, John Armstrong<> wrote:
    >>> Two items for the Modeler:
    >>> 1) Is there a reason it set to use a FileBrowser rather the the
    >>> FileDialog which is more powerful and 'user friendly' on Mac/Win?
    >>> 2) Whichever we use should default to the users homedir.
    >>> I can knock these changes out but before I did I wanted to see if
    >>> there was a specific reason they were not implemented in this manner.
    >>> I am still running M5 so it may be this way in later versions, my
    >>> apologies if this is the case.
    >>> I spend a lot of time clicking around that these two items would reduce ;)
    >>> Thanks!
    >>> John-

    This archive was generated by hypermail 2.0.0 : Tue Jun 23 2009 - 10:36:31 EDT