JFileChooser - unable to disable file extension display
Hello All,
I'm trying to use JFileChooser in my Swing application with following conditions:
1) Only xml files will be displayed
2) the file names shall NOT be shown with their extension. That is - listing of XML files shall occur only by their name - "abc" and not "abc.xml"
I've already acheived the 1st objective.
However, I am unable to block the display of file extension when JFileChooser opens.
Has the display of file extension got to do with Operating System feature?
Is there a way in Java Swings to curb such a a display?
Thanks
Implement your own FileView class (you can extend any of the L&F FileViews), then pass the object to:
JFileChooser::setFileView(FileView fileView);
Hint: The method you want to override is getName(File file).
Regards,
Marcin
Similar Messages
-
Hello,
Is there a way to disable the "Are you sure?" warning when you change file extensions in OS 10.5.7?
The server at my workplace only recognises one file extension (I don't know why, I just know that's the way it works). And I need to repeatedly change file names.
For example: The file MAG.feature_v1.doc has to be MAG.feature_v1 when we save it on our server.
When it's changed we need to change the filename to MAG.feature_v2, and the warning pops up.
I'm tired of clicking that confirm button 20 times a day, so is there a way around it?
Thanks.
- Richard@micp: That won't work. Mac OS X treats everything after a period as the file extension.
@khassani: That's brilliant. Thanks. Of course I feel like Homer now. (Simpson, not the poet.) -
Import images grid does not show file extension
I use Aperture in a "referenced" mode. At times, I have jpeg files in the same folder as my nef files (which had already been imported into Aperture). The import images list does not have (or I cannot find out how to display) the file name that shows the file extension too. Of the data available, i can scroll to the right and see a lot of different metadata in the list, but not the file extension.
Does anyone know how to have the file extension displayed in the list that is shown when trying to import?
thanksAperture can display just about anything you would like to display. The key is putting the correct field into the metadata set for that is being used for the browser or viewer that is active (you can have two ready to go and switch between them or none with a shortcut key)
This should tell you everything you ever didn't want to know
[Aperture Metadata Display|http://photo.rwboyer.com/2008/08/aperture-and-metadata-display>
RB -
Changing the file extension by entering a "?" in JFileChooser
Hi,
I've encountered a weird thing in JFileChooser. If you open the chooser, type at least one "?" in the field for the filename and then hit the approve button, the file extension will change to the text you entered as the filename.
To reproduce this problem, simply launch the JWSFileChooserDemo hit the "Open a File..."-button and as the filename enter something like "?deadbeef". Now click the open button and you will see that the file extension changes to "?deadbeef".
This is a really strange behaviour in my opinion.
I'm using Windows 7 with java 6u16, but the issue is the same on windows xp sp3. Perhaps on linux too. I'll give it a try as soon as I can.
Has anyone else encountered that problem?
Best regards
Edited by: Wurstsalat on Mar 23, 2010 10:30 AMTo reproduce this problemThis is not a problem but rather a feature. I did not know of this till now. Thanks for informing.
As Kevin pointed out this is related to filtering of files.
?deadbeefThis will match all the files which start with any letter followed by "deadbeef". So, ? is a wildcard meaning any one character. Other wildcard can be *, which means any number of characters. Try this:
*.txt
a*.txt
*.jp*g
??.txt I don't know other wildcards...
Thanks! -
Displaying file extension and "raw" tag in iPhoto 08
In iPhoto 06, filenames were displayed with their extensions and a "raw" tag was added.
In 08, the "title" field doesn't contain the file extension. Is this a result of the way I imported photos into 08? I used "import" to bring them in from folders on a network drive.
GlennI right clicked the RAW file, then chose "edit in separate window". I did crop, contrast, sharpen, etc. Then the "Done" button.
For example, I imported both RAW and JPEG from my CF card to iPhoto. They are IMG_3067.CR2 and IMG_3067.JPG, respectively. I then duplicated the first file and renamed the new one as IMG_7777.CR2. I did the edit like mentioned above on IMG_7777.CR2. Finally I clicked "Done". You can see that IMG_7777.CR2 differs from IMG_3067.CR2 but it still has the CR2 file extension.
Is this normal or I missed something here?
http://farm4.static.flickr.com/3170/28594822947e9d6b763ao.jpg
Message was edited by: KenWong -
I have a UCCX 8.0 (2) Installed.
Users here have limited access via proxy. Now everytime i try to run the CAD or CSD, i get the error:
"unable to download file" Could not open request.
It seems to want to install or check for an update.
The work around i have found is to go to the CAD directory and change the update.exe filename
C:\Program Files (x86)\Common Files\CAD\bin\update.exe
i dont want to have to do this for every user as i possibly want the update.
Is there a way to allow or bypass proxy on CAD?
Regards
JI had this problem before - to resolve it I disabled the proxy in internet explorer settings.
You'll need to make sure the CAD version matches your UCCX server version. Otherwise you may run in to issues.
Brian -
Display the file extension?
Is there a way to display the file extension? I want to tag some as PSD files and I want to delete all gif files. Currently I am opening each in Photoshop elements to get the extension, which is very cumbersome. I know I can see the extension in finder, but I cannot assign keywords in finder.
Thanks
bobNew Smart Album
Filename -> Contains -> psd
Regards
TD -
How to display names without file extension in Content Query Web Part in SharePoint 2010
I try to display names in Content Query Web Part but it shows file extension. I cannot find a way in CQWP editor that can exclude file extension. Is there a way to display names excluding file extensions thru settings in the CQWP editor?
I have to edit the code in SharePoint Designer, right?
Thanks in advance for any tips!In the file ContentQueryMain you have already a function to get the file without extension.
So we just can use this:
<xsl:call-template name="OuterTemplate.GetFileNameWithoutExtension">
<xsl:with-param name="input" select="$DisplayTitle" />
</xsl:call-template> -
Unable to Open Files without Extensions
Ever since updating to Mavericks and iWork 2013, I've noticed that Pages seems unable to open files that lack formal file extensions and the OS seems unable to accurately identify what type of file something is. For example, if I double-click on a Word document that doesn't have ".doc" or ".docx" in its filename (either shown or hidden), Pages will launch and then say the file "can't be opened." If I then change the filename to include ".doc" or ".docx" and try again, Pages will open the file successfully. It doesn't seem limited to iWork, though. Today I tried opening a PDF file that lacked a file extension. Pages launched and told me the file "can't be opened." I then added ".pdf" to the filename, double-clicked on it again, and the file successfuly opened in Preview. Any idea why the OS seems to be unable to tell what kind of files things are all of a sudden? Or why iWork and other apps seem unable to recognize and open files they used to be able to recognize and open? I don't have time to add file extensions to all my files! — Also, I thought this was a mature UNIX-based OS, not Windows 3.1...
Didn't realize I could edit my original post, so now this comment is superfluous...
-
Display File Extension in iPhoto?
I've just started to use iphoto. In the thumbnail view of an event (or for that matter, anytime I'm viewing a display of thumbnails), I would like iphoto to display file name and file extension. It's not doing that and I can't see a setting in iphoto preferences to enable file extensions. I know there's a Finder preference to show all extensions, and it is checked.
Is there a way to display file extensions?Yes.
Using Photoshop or Photoshop Elements as Your Editor of Choice in iPhoto.
1 - select Photoshop or Photoshop Elememts as your editor of choice in iPhoto's General Preference Section's under the "Edit photo:" menu.
2 - double click on the thumbnail in iPhoto to open it in Photoshop. When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done.
3 - however, if you get the navigation window
that indicates that PS wants to save it as a PS formatted file. You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
NOTE: With Photoshop Elements the Saving File preferences should be configured as shown:
I also suggest the Maximize PSD File Compatabilty be set to Always. In PSE’s General preference pane set the Color Picker to Apple as shown:
Note 1: screenshots are from PSE 10
Note: to switch between iPhoto and PS or PSE as the editor of choice Control (right)-click on the thumbnail and select either Edit in iPhoto or Edit in External Editor from the contextual menu. If you use iPhoto to edit more than PSE re-select iPhoto in the iPhoto General preference pane. Then iPhoto will be the default editor and you can use the contextual menu to select PSE for your editor when desired. -
Unable to change File Type for specific file extensions
Under Preferences->File Types different file extensions are assigned a file type e.g. The file extension .pkb is assigned the file type of PL/SQL. The file type of PL/SQL then opens the Code editor.
I have a user who would prefer to open .pkb files in the SQL Worksheet editor but I am unable to change the file type to SQL Script as the option is greyed out.
How do I change the File Type for these extensions? Is there a preferences file I need to change?
Version: 3.2.20.09
Thanks for your help.Hi,
There is no preference but it turns out you can manually edit one of the preferences.xml files to force PL/SQL types to use the SQL worksheet editor. For SQL Developer 3.2.20.09.87 that file is system3.2.20.09.87\o.sqldeveloper.11.2.0.9.87\preferences.xml and will be located (on Windows 7, for example) in directory C:\Users\<userid>\AppData\Roaming\SQL Developer
No guarantee this will work in future versions of the product, but for now you can add the following two xml blocks...
For example, for .pls, add to <extensionToContentTypeMap ...>
<Item>
<Key>.pls</Key>
<Value>TEXT</Value>
</Item>
and <userExtensionList>
<Item>
<docClassName>oracle.ide.db.model.SqlNode</docClassName>
<userExtensions class="java.util.ArrayList">
<Item class="oracle.ide.config.DocumentExtensions$ExtInfo">
<extension>.pls</extension>
<locked>false</locked>
</Item>
</userExtensions>
</Item> I researched this a while back after reading through some forum thread where someone claimed the PL/SQL file extensions got opened in the SQL editor in his environment, but without stating any specific release information. Possibly it worked for him then due to different product behavior (whether intentional or a bug), or perhaps even due to the technique described above.
Regards,
Gary
SQL Developer Team -
I am unable to open scanned documents (with .jpg file extension) in my e-mail inbox, on the Mail app on my iPad. Please provide a clear answer. Thanks a lot.
Can you actually see that the attachment has a .jpg extension? Some mail systems strip it off (I've seen AOL do that) which makes the attachment difficult to open.
-
Keynote file not displaying extension
I like to save my files with their extensions displayed. So I always make a point to uncheck "Hide Extension" when saving a Keynote file. But for some reason Keynote is being very stubborn -- whenever I save a file it decides to hide the extension. So I have to get info from Finder and uncheck "Hide Extension" after every save.
Is there any way I can get this setting to stick?
Thanks.I just opened a new presentation and attempted to save it and "Hide Extension" is not checked. What exact steps are you going through that leads to that being checked OR leads to you having a file saved without an extension?
AHA! When you initially save, you get that choice. If you close and then reopen that file, make some changes, and save again, it saves WITHOUT the extension. It seems like you'd have to do a Save As... all of the time in order to keep the extension.
Message was edited by: Kyn Drake -
Hide file extension from display in the iview
Hello my friends,
I display KM folder content in an iView in my portal. I want to hide the files extension but I just cann't find out how to do it.
Thanks in advance,
Udi Dekel.Hi Udi,
There is no such standard feature, but at least one possible workarounds:
- You may use a display name like "MyDocument" and the ID will be "MyDocument.doc" or whatever. The standard ResourceRenderer render the display name (with the ID as a tooltip)
A "solution" for all cases where the display name has got the file extension in its name would be to write your own property renderer for the display names, which then checks if there is a file extension, and if, then cut this off.
Hope it helps
Detlev -
JFileChooser unable to show japanese files on solaris
Hi,
In our application we are using JFileChooser to choose a file. JFileChosser unable to show file that has names in japanese characters on solaris japanese os. Where as on windows it works fine.Plese help me about the above
Thanks,
PraveenWhich JDK version you are using .. When i tried the example with default JDK(1.5) of my solaris box JFileChooser works fine .But we user JDK1.6 in our application. Hope there is some problem with the JDK.
Maybe you are looking for
-
i have just got a new tablet pc ( gemini ) running android 4.1.1, when i log on to the bingo site and start to play bingo it say`s plugin required, i know flash player is running as it will let you play video from the same site, but when you click pl
-
How do I get the website icon to stay on the desktop?
When I save a webpage to my desktop, via "drag webpage address to desktop", the website icon is replaced by a mozilla icon. How do I get the website icon to stay on the desktop?
-
Bootcamp not releasing services
My wife's Mini (early 2009, 2GB RAM, 120GB HDD) has developed a new problem: when she tries to switch from Windows XP Pro SP3 to Snow Leopard using the diamond shaped icon in the systray the desktop freezes (you can move the cursor but nothing else r
-
HT1710 password doesn't work after archive and install
I was advised to do an Archive & Install, without preserving info to see if it would fix a weird slowness issue. I just did the Archive & Install, and when it restarted, it showed my name and photo, but it wouldn't accept my password. I can't login.
-
EJB Deployment error(It's Ugent)
Hi there, i'm gettin the following error while deploying the EJB. Pl'z lookin into and suggest me some solution for this. Fri Feb 25 16:20:48 EST 2000:<E> <EJB> Could not deploy: 'D:/ejb+mail/ejb-eg/bea demo/beanew2.jar': file is not a valid jar file