The Source for Java Technology Collaboration

Home » java.net Forums » Java Desktop Technologies » SwingLabs

Thread: FileChooser component, please!

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 10 - Last Post: Jul 18, 2008 4:33 PM by: cowwoc
cowwoc

Posts: 1,055
FileChooser component, please!
Posted: Jul 14, 2008 1:07 PM
 
  Click to reply to this thread Reply

A year ago I asked the SwingX team to introduce a replacement for JFileChooser. There was a lot of discussion and we agreed to wait for a response from Sun (whether they were going to fix JFileChooser themselves).

Well, it now looks like JFileChooser isn't going to be fixed anytime soon. I have filed one bug report after another and either those issues sit idle or they get closed by Sun engineers who don't fix them properly. For example, notice how http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6207989 introduces a CTRL-ENTER keystroke to the Windows L&F instead of ENTER which native applications expect. To make matters worse, ENTER does the wrong thing under Windows L&F.

I am just so sick and tired of this run around already. I tried looking into modifying JFileChooser myself but it was a huge mess and I couldn't understand where to make the modifications.

So I will ask again: will the SwingX staff *please* introduce a replacement for JFileChooser?

Yours truly,
Gili

kschaefe

Posts: 1,662
Re: FileChooser component, please!
Posted: Jul 14, 2008 1:21 PM   in response to: cowwoc
 
  Click to reply to this thread Reply

First, file an enhancement request.
Second, locate the previous thread and any other discussions that we've had regarding a new file chooser.
Third, locate the relavant bugs.sun.com bugs.
Fourth, what new things should this chooser support? Or, rather what old things but in a better way? These are (most likely) not bug-related.
Fifth, start the discussion of expectations:
What is it we want SwingX to do about these bugs/issues?
What is a JXFileChooser going to do that isn't available in the normal chooser?
Is this a bugs only fix? (Unlikely to get SwingX support, better to drum up support on OpenJDK.)

Add anything else that I've missed.

Karl

cowwoc

Posts: 1,055
Re: FileChooser component, please!
Posted: Jul 14, 2008 3:41 PM   in response to: kschaefe
 
  Click to reply to this thread Reply

> First, file an enhancement request.

Where?

> Second, locate the previous thread and any other
> discussions that we've had regarding a new file
> chooser.

The two main threads I recall are:

http://forums.java.net/jive/thread.jspa?messageID=223003
http://forums.java.net/jive/thread.jspa?messageID=216141

but I'm sure there are others.


> Third, locate the relavant bugs.sun.com bugs.

Here are the 259 (!!) JFileChooser bugs : http://bugs.sun.com/search.do?process=1&category=java&bugStatus=1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9&subcategory=classes_swing&type=bug&keyword=jfilechooser

Here are the 29 FileDialog bugs: http://bugs.sun.com/search.do?process=1&category=java&bugStatus=1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9&subcategory=classes_awt&type=bug&keyword=filedialog

I think it is pretty clear these will never get fixed anytime soon. Remember, I am only listing open bugs reports (not RFEs or closed issues).

> Fourth, what new things should this chooser support?
> Or, rather what old things but in a better way?

Am I not asking for any new features what-so-ever. I am simply asking for all the JFileChooser and FileDialog bugs to be fixed. Neither is even close to behaving like the native dialog.

Probably the quickest way to solve this is to fix FileDialog (since it requires the least amount of flexibility, features and bug fixes) but in the long run I'd obviously also like to see JFileChooser fixed.

> fth, start the discussion of expectations:
> What is it we want SwingX to do about these
> bugs/issues?

Implement a clean-room JFileChooser implementation with long-term maintenance in mind.

> What is a JXFileChooser going to do that isn't
> available in the normal chooser?

Behave like a native chooser under Windows, for one. There are literally tens of highly visible bugs that make JFileChooser a nightmare to use (especially if you use the keyboard).

> Is this a bugs only fix? (Unlikely to get SwingX
> support, better to drum up support on OpenJDK.)

I don't think OpenJDK will be willing to introduce an entirely new component, and like I said, I believe the only way to kill all these bugs is to rewrite the entire component.

Thanks Karl :)

kirillcool

Posts: 795
Re: FileChooser component, please!
Posted: Jul 14, 2008 3:57 PM   in response to: cowwoc
 
  Click to reply to this thread Reply

> and like I said, I believe the only way to kill all these bugs is to rewrite the
> entire component.

That reminds me of http://www.joelonsoftware.com/articles/fog0000000069.html

cowwoc

Posts: 1,055
Re: FileChooser component, please!
Posted: Jul 14, 2008 4:05 PM   in response to: kirillcool
 
  Click to reply to this thread Reply

> > and like I said, I believe the only way to kill all
> these bugs is to rewrite the
> > entire component.
>
> That reminds me of
> http://www.joelonsoftware.com/articles/fog0000000069.h
> tml

As much as I love Joel's work (I've read his entire blog cover to cover) I disagree with him on this one. I don't think you can apply such a rule without limitation. I will agree that *most of the time* you should think twice before rewriting a component. But sometimes it makes perfect sense, like when the authors of the components are long gone and there module has a long history of being extremely buggy. In such cases there are studies that show it takes less time to rewrite against a specification than clean up the existing implementation. This probably becomes more true the smaller the module is.

I don't think you can honestly compare compare rewriting an entire browser (which is a VM in its own right) to rewriting a file chooser component.

kirillcool

Posts: 795
Re: FileChooser component, please!
Posted: Jul 14, 2008 4:24 PM   in response to: cowwoc
 
  Click to reply to this thread Reply

> I don't think you can honestly compare compare
> rewriting an entire browser (which is a VM in its own
> right) to rewriting a file chooser component.

Gili,

Your multiple posts on the JFileChooser on Windows platforms over the past couple of years indicate great attention to all the small details that vary even between the Windows platforms. Now take that and extend to other supported platforms, including playing nicely with Mac, even if it's not developed directly by Sun. Now take that and extend to non-system look-and-feels, including core Metal / Nimbus and the existing third-party look-and-feels.

So, yes, it still does not compare with a web browser. But it is a gigantic task as compared to other core Swing components, if you do want to provide complete platform fidelity for all the target platform. I have asked this before [1], and i will ask once again. Would you undertake to reimplement it from the scratch? If the answer is "no, i don't have time due to all these other things that are more important to me", the same would be true for the other side as well.

It is reasonable to expect this from the core Swing team, and it is reasonable to request this from volunteers that spend their free time on SwingX. It is also reasonable to lend a helping hand if these teams have different priorities. It is also reasonable to explore other alternatives such as the SWT option that i have mentioned. I have done this for text rasterization [2] addressing the very poor Java2D rasterization of Segoe UI on Vista, and i'm pretty sure that your >2yr old itch should be by now big enough to explore this path as well.

Thanks
Kirill

[1] http://forums.java.net/jive/thread.jspa?messageID=225633#225633
[2] http://www.pushing-pixels.org/?p=219

profiler

Posts: 13
Re: FileChooser component, please!
Posted: Jul 15, 2008 8:32 PM   in response to: kirillcool
 
  Click to reply to this thread Reply

There are some components that should never have even been implemented in swing in the first place: print dialogs and file choosers. These by definition are platform specific. Sun got it right by not making a swing print dialog, but tried to make a file chooser - noble but a simpler option would be to use a native dialog.

Its simple to use a native dialog from one of the many frameworks available (we use jniwrapper). There are many more important things for Sun to be developing right now, and that includes video.

cowwoc

Posts: 1,055
Re: FileChooser component, please!
Posted: Jul 18, 2008 4:33 PM   in response to: profiler
 
  Click to reply to this thread Reply

There are two problems with what you wrote:

1) There is a Swing print dialog

2) I don't want to (nor should I have to) learn how to use the win32 API to display a file dialog. Sun needs to provide some cross-platform API, even if the look differs. I would be fine if FileDialog was fixed (right now it doesn't look native).

kirillcool

Posts: 795
Re: FileChooser component, please!
Posted: Jul 14, 2008 2:34 PM   in response to: cowwoc
 
  Click to reply to this thread Reply

> I am just so sick and tired of this run around
> already. I tried looking into modifying JFileChooser
> myself but it was a huge mess and I couldn't
> understand where to make the modifications.
>
> So I will ask again: will the SwingX staff *please*
> introduce a replacement for JFileChooser?

I think you meant "volunteers who do it on their own free time" and not "staff". I personally wouldn't touch JFileChooser with a six-foot pole, but hey, that's just me. By the way, have you considered using SWT file chooser? It's not that you're expecting the current look-and-feel to skin the JFileChooser, right? It will involve bundling the SWT jar and native libraries, but at least it's better than getting angry at all the existing bugs...

Noel Grandin
Re: FileChooser component, please!
Posted: Jul 15, 2008 1:07 AM   in response to: cowwoc
  Click to reply to this thread Reply

Go to
http://openjdk.java.net/

and start writing patches.

JFileChooser may be complicated, but that's the price for writing
cross-platform code.

Interestingly, I've been doing Swing apps on and off for 10 years and
none of my users has ever complained about JFileChooser.

Regards, Noel.

jdnc-interest@javadesktop.org wrote:
> A year ago I asked the SwingX team to introduce a replacement for JFileChooser. There was a lot of discussion and we agreed to wait for a response from Sun (whether they were going to fix JFileChooser themselves).
>
> Well, it now looks like JFileChooser isn't going to be fixed anytime soon. I have filed one bug report after another and either those issues sit idle or they get closed by Sun engineers who don't fix them properly. For example, notice how http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6207989 introduces a CTRL-ENTER keystroke to the Windows L&F instead of ENTER which native applications expect. To make matters worse, ENTER does the wrong thing under Windows L&F.
>
> I am just so sick and tired of this run around already. I tried looking into modifying JFileChooser myself but it was a huge mess and I couldn't understand where to make the modifications.
>
> So I will ask again: will the SwingX staff *please* introduce a replacement for JFileChooser?
>
> Yours truly,
> Gili
> [Message sent by forum member 'cowwoc' (cowwoc)]
>
> http://forums.java.net/jive/thread.jspa?messageID=286548
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
> For additional commands, e-mail: jdnc-help@jdnc.dev.java.net
>
>
>


Disclaimer: http://www.peralex.com/disclaimer.html



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


carcour

Posts: 79
Re: FileChooser component, please!
Posted: Jul 15, 2008 7:07 AM   in response to: cowwoc
 
  Click to reply to this thread Reply

The FileDialog improvements were due to be introduced in Java 7 so let's give Sun a chance. Now most Sun engineers are busy with JavaFX. I hope Sun will do something about it.
Rewriting JFileChooser is not a good option as the native FileDialog evolve with each OS release and it's not a straightforward component to change.
We've asked about this http://forums.java.net/jive/thread.jspa?messageID=107026&#107026 (2006) and http://forums.java.net/jive/thread.jspa?messageID=233418&#233418 (2007)

Thanks,

Carl




 XML java.net RSS