HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- AWT FileDialog on HP-UX11 UNIX CDE-- File names no...
Operating System - HP-UX
1833852
Members
1885
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 09:25 AM
01-27-2004 09:25 AM
AWT FileDialog on HP-UX11 UNIX CDE-- File names not alphabetized
Hello all,
I've written an editor program in Java to be deployed on an HP-UX11 UNIX server. It uses the AWT FileDialog object to select files to open. It works properly except for the fact that the files are listed in seemingly random order, and this is a serious defect for our end system because the user will have to look through thousands of files.
Also, switching to the Swing FileChooser is not an option for our project.
I see no property or method in the FileDialog class JDK 1.4.2 specification that alphabetizes, and I've noticed that the FileDialog is system dependent, because it looks different (and has more features) in Windows XP.
Is there anything I can do fix the FileDialog on HP-UX 11, or do I have to write my own Dialog that aphabetizes?
Thanks,
Dan
I've written an editor program in Java to be deployed on an HP-UX11 UNIX server. It uses the AWT FileDialog object to select files to open. It works properly except for the fact that the files are listed in seemingly random order, and this is a serious defect for our end system because the user will have to look through thousands of files.
Also, switching to the Swing FileChooser is not an option for our project.
I see no property or method in the FileDialog class JDK 1.4.2 specification that alphabetizes, and I've noticed that the FileDialog is system dependent, because it looks different (and has more features) in Windows XP.
Is there anything I can do fix the FileDialog on HP-UX 11, or do I have to write my own Dialog that aphabetizes?
Thanks,
Dan
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2004 06:02 AM
01-28-2004 06:02 AM
Re: AWT FileDialog on HP-UX11 UNIX CDE-- File names not alphabetized
I did a quick test and found that this happens on both HP-UX with Java 1.4and Linux (I used Blackdown Java on Mandrake 9.1).
This would appear to be a limitation of the base AWT FileDialog class. I think that you will probably have to do something with the setFileFilter() method to get a list of files and sort them.
This would appear to be a limitation of the base AWT FileDialog class. I think that you will probably have to do something with the setFileFilter() method to get a list of files and sort them.
Necessary questions: Why? What? How? When?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2004 07:24 AM
01-28-2004 07:24 AM
Re: AWT FileDialog on HP-UX11 UNIX CDE-- File names not alphabetized
I suspect that FileDialog is probably built using the File class and uses the listFiles() method to get the list of files. This is from the File.listFiles() method documentation:
listFiles
public File[] listFiles()
Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname.
If this abstract pathname does not denote a directory, then this method returns null. Otherwise an array of File objects is returned, one for each file or directory in the directory. Pathnames denoting the directory itself and the directory's parent directory are not included in the result. Each resulting abstract pathname is constructed from this abstract pathname using the File(File, String) constructor. Therefore if this pathname is absolute then each resulting pathname is absolute; if this pathname is relative then each resulting pathname will be relative to the same directory.
There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.
Returns:
An array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname. The array will be empty if the directory is empty. Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs.
Throws:
SecurityException - If a security manager exists and its SecurityManager.checkRead(java.lang.String) method denies read access to the directory
Since:
1.2
So, I would guess that you are going to have write your own filter.
listFiles
public File[] listFiles()
Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname.
If this abstract pathname does not denote a directory, then this method returns null. Otherwise an array of File objects is returned, one for each file or directory in the directory. Pathnames denoting the directory itself and the directory's parent directory are not included in the result. Each resulting abstract pathname is constructed from this abstract pathname using the File(File, String) constructor. Therefore if this pathname is absolute then each resulting pathname is absolute; if this pathname is relative then each resulting pathname will be relative to the same directory.
There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.
Returns:
An array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname. The array will be empty if the directory is empty. Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs.
Throws:
SecurityException - If a security manager exists and its SecurityManager.checkRead(java.lang.String) method denies read access to the directory
Since:
1.2
So, I would guess that you are going to have write your own filter.
Necessary questions: Why? What? How? When?
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP