Up button in JFileChooser (Windows L&F)

If you keep clicking the Up button in JFileChooser, eventually it'll go to My Computer, then Desktop, the My Documents, and then keep alternating between Desktop and My Documents.

Question is, is there a rational for this? Wouldn't it be more intuitive to stop at some "topmost" destination folder, being Desktop or My Documents? Going "up" and "down" seems confusing, at least to the end user.

[409 byte] By [lexthanga] at [2007-11-27 7:05:37]
# 1
Because in Windows, "Desktop" is a virtual directory that really is in "My Documents". What happens is that the button will always work as long as the current location has a non-null parent location.
bsampieria at 2007-7-12 18:56:51 > top of Java-index,Desktop,Core GUI APIs...
# 2

Thanks. But if Desktop is really in My Documents, why can't the button stop at My Documents as the topmost directory?

I understand that as long as there is a non-null parent, the button still has some way to go. But we can just as easily say My Documents has no parent, instead of saying its parent is one of its children, right? Are we breaking something if we have that?

lexthanga at 2007-7-12 18:56:51 > top of Java-index,Desktop,Core GUI APIs...
# 3
The native filechooser stops at Desktop, even if technically the Desktop is under My Documents.
kirillga at 2007-7-12 18:56:51 > top of Java-index,Desktop,Core GUI APIs...
# 4
By native you mean the JFileChooser in native L&F?If so, the behaviour is deliberate for Windows L&F then. Still don't know why.
lexthanga at 2007-7-12 18:56:51 > top of Java-index,Desktop,Core GUI APIs...
# 5
By native i mean Windows' own file chooser - nothing to do with Java. If Windows LAF wants to "feel" native, it needs to emulate this behavior.
kirillga at 2007-7-12 18:56:51 > top of Java-index,Desktop,Core GUI APIs...
# 6
The File.Open dialog in both notepad and Winword stop at Desktop. The Up button will be disabled when you're in Desktop directory.Apparently Java is not Windows-"native" in this regard.
lexthanga at 2007-7-12 18:56:51 > top of Java-index,Desktop,Core GUI APIs...
# 7
Isn't this what i said?
kirillga at 2007-7-12 18:56:51 > top of Java-index,Desktop,Core GUI APIs...
# 8
Yes, I'm just trying to clarify. I don't disagree with you.
lexthanga at 2007-7-12 18:56:51 > top of Java-index,Desktop,Core GUI APIs...
# 9

How is 'Desktop' a virtual directory when the desktop folder actually exists in C:\<Users|Documents and Settings>\<User>\Desktop?

I would call that a code issue unless my definition of 'virtual folder' is different than yours.

From what I know, the Windows file chooser usually does this when going up directories:

Current directory>Possibly a few more directories>%SystemDrive%\>My Computer>Desktop

As in that example, everything should go back to the Desktop (even My Documents) in the end. And I would guess that the JFileChooser does (or should) follow that path to blend in better with other Windows apps.

timothyb89_a at 2007-7-12 18:56:51 > top of Java-index,Desktop,Core GUI APIs...