[sip-comm-dev] Using AWT's FileDialog instead of Swing's JFileChooser


#1

Hello all,

I'm writting to ask you about adopting AWT's FileDialog instead of
the JFileChooser of Swing, currently used in SIP Communicator.

Using FileDialog in Mac OS X allows to have the native Mac file dialog chooser,
which is more "nice" or "easy to live with" than JFileChooser.

Screenshots and official Apple doc:
http://developer.apple.com/mac/library/documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html

I've tested it on Windows XP and I didn't see any difference between both them. Do I'm right?
I'd like to know if someone here could tell me if the appearance of these two dialogs are similar on Linux?

WDYT about it?

Kind regards,
Valentin

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hi Valentin,

> I'd like to know if someone here could tell me if the appearance of these two dialogs are similar on Linux?

I'm sending screenshots of AWT FileDialog and Swing JFileChooser on Ubuntu. Please note that I haven't gone into applying the GTK+ theme to the Swing JFileChooser for the screenshot but when it's run inside SIP Communicator it picks it up so it more closely matches the other applications.

> WDYT about it?

I personally like Swing JFileChooser on Ubuntu better than AWT FileDialog. I guess if AWT FileDialog on Mac OS X is closer in its looks (and feel?) to the system one, it wouldn't be too hard to switch between the two at runtime depending on the OS.

Regards,
Lubomir

···

On 25.09.2009 01:30, Valentin MARTINET wrote:

Hello all,

I'm writting to ask you about adopting AWT's FileDialog instead of
the JFileChooser of Swing, currently used in SIP Communicator.

Using FileDialog in Mac OS X allows to have the native Mac file dialog chooser,
which is more "nice" or "easy to live with" than JFileChooser.

Screenshots and official Apple doc:
http://developer.apple.com/mac/library/documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html

I've tested it on Windows XP and I didn't see any difference between both them. Do I'm right?
I'd like to know if someone here could tell me if the appearance of these two dialogs are similar on Linux?

WDYT about it?

Kind regards,
Valentin


#3

Hi Lubomir,

Lubomir Marinov a �crit :

I'm sending screenshots of AWT FileDialog and Swing JFileChooser on Ubuntu. Please note that I haven't gone into applying the GTK+ theme to the Swing JFileChooser for the screenshot but when it's run inside SIP Communicator it picks it up so it more closely matches the other applications.

> WDYT about it?

I personally like Swing JFileChooser on Ubuntu better than AWT FileDialog. I guess if AWT FileDialog on Mac OS X is closer in its looks (and feel?) to the system one, it wouldn't be too hard to switch between the two at runtime depending on the OS.

Yes, it obviously looks better :slight_smile:
Thanks for the screenshots! I will look into SC's code for the startup and will send feedback soon.

Best regards!
Valentin

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hey Valentin,

Could you post a screenshot of the dialogs as you see them?

I just checked and I do get a native Mac OS X dialog when trying to
send a file for example.

Cheers,
Emil

···

On Fri, Sep 25, 2009 at 2:34 PM, Valentin MARTINET <vmartinet.sipcommunicator@gmail.com> wrote:

Hi Lubomir,

Lubomir Marinov a écrit :

I'm sending screenshots of AWT FileDialog and Swing JFileChooser on
Ubuntu. Please note that I haven't gone into applying the GTK+ theme to the
Swing JFileChooser for the screenshot but when it's run inside SIP
Communicator it picks it up so it more closely matches the other
applications.

> WDYT about it?

I personally like Swing JFileChooser on Ubuntu better than AWT FileDialog.
I guess if AWT FileDialog on Mac OS X is closer in its looks (and feel?) to
the system one, it wouldn't be too hard to switch between the two at runtime
depending on the OS.

Yes, it obviously looks better :slight_smile:
Thanks for the screenshots! I will look into SC's code for the startup and
will send feedback soon.

Best regards!
Valentin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31


#5

Emil Ivov a �crit :

Hey Valentin,

Could you post a screenshot of the dialogs as you see them?
  

Here there are:
    - original.png is the Swing JFileChooser
    - new.png is the AWT FileDialog

I just checked and I do get a native Mac OS X dialog when trying to
send a file for example.

When trying to send a file, I get a JFileChooser (as in original.png).
I call the AWT FileDialog as "native Mac OS W dialog".Maybe I'm using wrong terms?

Regards,
Valentin


#6

I understand. I get the same results as you and I agree that the AWT
chooser is more convenient (although FWIW I think they are both native).

Therefore a patch that uses the AWT one on Mac only would be welcome.

We should probably think of a global SC chooser that others could also
use and that would hide the selection logic.

util.swing seems like a good place to store it.

Cheers,
Emil

Valentin MARTINET wrote:

···

Emil Ivov a écrit :

Hey Valentin,

Could you post a screenshot of the dialogs as you see them?
  

Here there are:
    - original.png is the Swing JFileChooser
    - new.png is the AWT FileDialog

I just checked and I do get a native Mac OS X dialog when trying to
send a file for example.

When trying to send a file, I get a JFileChooser (as in original.png).
I call the AWT FileDialog as "native Mac OS W dialog".Maybe I'm using
wrong terms?

Regards,
Valentin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#7

Hi Emil,

Emil Ivov a �crit :

Therefore a patch that uses the AWT one on Mac only would be welcome.
  

It's planned :slight_smile:

We should probably think of a global SC chooser that others could also
use and that would hide the selection logic.
  

I agree. Theoretically, it should be automatically set by using the following property:
System.setProperty("apple.awt.fileDialogForDirectories", "true");

I've tested it, and the AWT FileDialog is not used everywhere in SC.
Moreover, files appear as disabled, so this is embarassing.

util.swing seems like a good place to store it.

Ok!

Regards,
Valentin

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net