JFileChooser wiping filename on selecting a new filter / file type

Got a new and annoying little quirk with File Chooser under 1.4.2 (actually using 1.4.2_01 here). The new L&F for Windows XP is great, but whenever I type a filename and change the file type, whatever I've typed gets cleared and I'm forced to re-type, or reselect the filename again..? any ideas on why or ways to prevent this behaviour; previous versions of this dialog didn't do this, nor do the native dialogs.
- Richard

The culprit is line 2068 in WindowsFileChooserUI, in the listener for the combobox someones added the explicit command setFileName(null); in the 1.4_xx versions.
I've gotten around this with a little side-shuffle, create your own FileChooserUI thusly:
public class MyWindowsFileChooserUI extends WindowsFileChooserUI {
    public MyWindowsFileChooserUI(JFileChooser filechooser) {
        super(filechooser);
    public static ComponentUI createUI(JComponent c) {
        return new MyWindowsFileChooserUI((JFileChooser)c);
    // patch the filter change filename blanking bug 4678049
    public void setFileName(String filename) {
        if (filename != null) {
            super.setFileName(filename);
}and install it as the default somewhere in your code like this;
if (UIManager.getLookAndFeel().getName().equals("Windows")) {
UIManager.put("FileChooserUI", "osbaldeston.swing.MyWindowsFileChooserUI");
}All filechoosers created after this assignment shouldn't blindly wipe the filename anymore. Other look & feels seem to have the same problem, with the same line in the same routine; so overriding the FileChooserUI L&F of your choice with a modified version of the above (MyMetalFileChooserUI etc..) should work just fine.
(sorry jeff)

Similar Messages

  • Cant select php as a file type

    When opening a new file i can no longer select php as the
    file type. The site is set as php/mysql but nothing.
    any ideas

    Huh? FILE | New is all you need to do.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "cymonsez" <[email protected]> wrote in
    message
    news:gnhdg5$sat$[email protected]..
    > When opening a new file i can no longer select php as
    the file type. The
    > site is set as php/mysql but nothing.
    >
    > any ideas

  • What is the method for folder-browsing and selecting a non media file type in Android? [Air+AS3]

    Dear Gurus,
    Being a newbie, I have been searching hi & low for the method to browse and select non-media related file type in android.
    Besides the following these which I have reference from the AS3 Documentation (http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7fe4.html#WS5b3cc c516d4fbf351e63e3d118676a4c56-7ff0)
    var fileToOpen = File.documentsDirectory.resolvePath("");
                                  selectFile(fileToOpen);
                                  function selectFile(root:File):void
                                                 //var txtFilter:FileFilter = new FileFilter ("3D Model File", "*.obj; *.3ds;*.awd");
                                                 root.browseForOpen("Open",null);
                                                 root.addEventListener(Event.SELECT, selectedFile);
                                  function selectedFile(e:Event):void
                                                 trace(fileToOpen.nativePath + " file selected");
    I have went through the following threads yet find no clear workable solution to it.  The closest reference is written in Flex MXML, and I have no luck for converting it to AS3 as there are several properties which I can't get it right.
    http://forums.adobe.com/thread/943887 | http://forums.adobe.com/message/4107990#4107990 | http://forums.adobe.com/message/4548154
    Someone did mention some possible solutions through ANE but it is just too far beyond.  Even, the closest on-the-shelf solution of ANE by http://myappsnippet.com/file-browser-air-extension/ only work best to an extent and not truely "native" as the UI is not default from Android.  It has workable I/O but poor usability; you can't skin it.
    Is there any other workaround solution to this general I/O question?  I would love to hear from everyone here.

    The short answer to my knowledge is there is nothing you can invoke from AIR to open an OS-level dialog to browse/select a file. All implementations typically are people writing their own browser. They crawl the folders/files recursively and write their own display for the files. You can see a few on SO:
    http://stackoverflow.com/questions/12255418/as3-air-browse-for-file-on-sd-card
    http://stackoverflow.com/questions/12257626/as3-get-zip-file-on-phone-from-app-file-path-t hen-unzip
    It's not to terribly hard to code something like this (especially with that starter code). Otherwise, like you found, an on-the-shelf ANE is the only way I believe you can invoke the Android Intent for a file dialog. At that point skinning won't really be terribly easy given the nature of Android users who are completely allowed to customize their UI top to bottom.
    The safest bet is just let that posted code recurse and find the files you tell it to while displaying the list to the user. You can use some pre-written GPU-level lists that you can skin yourself using FeathersUI:
    http://www.feathersui.com (uses Starling)
    Or you can use one of the Flash Pro List components which will be quite a bit slower being they're not GPU optimized like some Flex Spark components.

  • Filter file type for af:inputFile

    Hi,
    I am using jDeveloper 11.1.2.4.0.
    I used af:inputFile to get an image file and save the file to the server.
    Is it possible to filter file types when I browse file from af:inputFile? My users would like to see only image files when they browse in the directory.
    Thanks.
    nat

    <input type="file"> has property "accept", so you can add this attribute after page load, for example:
    <af:clientListener method="onPageLoad" type="load"/>
    <f:facet name="metaContainer">
        <af:resource type="javascript">
            function onPageLoad(evt) {
      // yourInputFileId is id of <input type="file"> element so you need to use firebug or similar tool to find this id
                document.getElementById("yourInputFileId").setAttribute("accept", "image/*");
        </af:resource>
    </f:facet>
    but note that this property is not supported in all browsers (especially in IE )
    Dario

  • With Premiere elements 11, when Publish/Share (saving) a finished video, selecting H.264  .mov file type, what are the recommended Codec and Aspect settings for a crisp video and a small file size?

    With Premiere Elements 11, when Publish/Share (saving) a finished video, selecting H.264  .mov file type, what are the recommended Aspect and Codec settings , for a crisp video with a small file size?

    Gary Krouse
    We will customize a very detailed reply, but
    (a) What are the properties of your source media?
    (b) What did you or the program set as the project preset to match the properties of the source media?
    (c) What specific requirements do you have for this H.264.mov export file?
    File size can be a compromise between bitrate, file size, and quality.
    Thanks.
    ATR

  • How to get online help when creat new filter files in EDS?

    I want to creat some my own filter files in order to get Event report from network management station when some special situations appear.
    I have run /opt/CSCOpx/bineds -filter,and the Named Filter window appears,I select new a file,later select "add Generic events",during this course I tried to get online help with Help Icon, but the messages:"could not run netscape to display help netscape:not found."appears.
    But I have install the netscape in the directory /opt/netscape, why it can't be found?I want to know whether there is some conf file in some place that has named a path name for the netscape diffrent from /opt/netscape.Is ther any such files?Thanks very much!

    Since there has been no response to your post, it appears to be either too complex or too rare an issue for other forum members to assist you. If you don't get a suitable response to your post, you may wish to review our resources at the online Technical Assistance Center (http://www.cisco.com/tac) or speak with a TAC engineer. You can open a TAC case online at http://www.cisco.com/tac/caseopen
    If anyone else in the forum has some advice, please reply to this thread.
    Thank you for posting.

  • Allow filter file type at import!

    It should be possible to exclude/include file types, especially video/image in the import wizard (or through some preference).

    Lossless is really good, however the files are large and will drain your battery quicker. I settled on AAC at 192kbps as an acceptable Quality to Battery life compromise. MP3 will be more compatible if you wish to use the tracks on non Apple hardware or software.
    Here's an article that compares formats: http://www.recordstorereview.com/misc/aacmp3part2.shtml

  • Strange new RoboHelp file types

    There are some weird file types showing up in my RoboHelp
    project: trb, .trf, .tridxl, .trk, .trl, .trs., .trt, .trtocl,
    .trv.
    I've seen two postings in the RoboHelp forums, but no one
    seems to know why they're appearing. I found them with Beyond
    Compare when I was getting ready to check them into source control
    (Microsoft Visual Studio).
    Does anyone know what these are? They didn't show up in
    Adobe's knowledgebase or in a Google search.

    I'm not positive, but I think I saw some of these before.
    They were temporary files that appeared during output generation.
    When RH was done generating the output files, the files
    disappeared.
    If I'm recalling/identifying these files correctly, then
    maybe that means your output generation didn't terminate cleanly. I
    wouldn't put those files into source control.
    G

  • FIREFOX 4 CRASHES WHEN I USE THE "BROUSE" MODE TO SELECT A PROGRAM TO OPEN A PARTICULAR FILE TYPE

    USING TOOLS-OPTIONS- APPLICATION BRINGS UP THE PANEL TO SELECT PROGRAMS FOR EACH FILE TYPE. SELECTING "USE OTHER" BRINGS ANOTHER PANEL WITH VARIOUS OPTIONS. NONE OF THESE ARE APPROPRIATE FOR MY SITUATION. AS SOON AS I CLICK "BROWSE" FIREFOX CRASHES. THE SAME THING HAPPENS IF I SELECT AN ATTACHMENT FROM AN EMAIL AND TRY TO CHANGE THE ASSOCIATED PROGRAM BY USING "BROWSE" TO FIND AN APPROPRIATE PROGRAM.

    You can uninstall (remove) the Java Console extensions and disable the Java Quick Starter extension, you do not need them to run Java applets.
    See http://kb.mozillazine.org/Java#Multiple_Java_Console_extensions
    See also http://www.java.com/en/download/help/quickstarter.xml - What is Java Quick Starter (JQS)? What is the benefit of running JQS? - 6.0
    Disable the Java Quick Starter extension: Tools -> Addons -> Extensions<br />
    Control Panel -> Java -> Advanced tab -> Miscellaneous -> Java Quick Starter (disable)
    See:
    * http://kb.mozillazine.org/Firefox_crashes
    * [[Firefox crashes]]
    Create a new profile as a test to check if your current profile is causing the problems.
    See [[Basic Troubleshooting#Make_a_new_profile|Basic Troubleshooting&#58; Make a new profile]]
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins"
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Filter file formats?

    Hi,
    Is it possible to filter which file format Bridge or Mini Bridge will show?
    I use Photoshop only for 2D images so it´s quite irritating that ie. Mini Bridge in PS CS5 shows all the 3D-files, text files, rar-directories etc. I would like it to only show image files, vector files and PDF-files. Plus folders of course.
    Is it possible to block  Bridge to not show some file formats?
    Thanks!

    Hi BuiltDown,
    In Bridge, you can filter file type in Filter Panel, which is at the left-bottom of Bridge window by default. You can click and select the file formats you'd like to see in the content panel, and click one selected type by pressing Alt key will select all other file types. Clicking the pin icon at the bottom of Filter Panel will keep your filters when browsing to other folders.
    In Mini Bridge, just as Curt mentioned, currently there is no way to filter out file types in UI.
    Chun Xia
    Bridge QE

  • Filter Open Dialog File Types

    I want to filter file types in the open dialog. By reading the Photoshop CS3 scripting reference, I understand it is different if you want it to work on a Mac. So my question is how do you filter file types on a Mac computer. I know how to do it for a Windows platform (Example: *.psd)
    This is what the JavaScript Tools Guide PDF says:
    ● In Windows, a filter expression, such as "*.jsx"
    ● In Mac OS, a filter function that takes a File instance and returns true if the
    file should be included in the display, false if it should not.

    [email protected] wrote:
    > I want to filter file types in the open dialog. By reading the Photoshop CS3 scripting reference, I understand it is different if you want it to work on a Mac. So my question is how do you filter file types on a Mac computer. I know how to do it for a Windows platform (Example: *.psd)
    >
    function filter(file) {
    return file.name.match(/\.psd$/i) != null;
    Or you could do something like this:
    function filter(file) {
    return file.creator = 'XXXX' && file.type == 'XXXX';
    where XXXX are whatever they should be on a Mac. You could write a conversion
    function that takes a Win-formatted pattern (*.psd) and returns a function that
    works for the Mac. I tried but never did get it working for anything other than
    simple patterns; it just wasn't that necessary for my work.
    -X

  • PMS: Creation of new filter values

    Dear Reader,
    I am working on a PMS implementation where one particular appraisal template has multiple appraisers. The only way I can attach and identify between multiple appraisers is by creating new filters in table T77HAP_FLT_SEL.
    I plan to then use BADI implementations to help identify the persons for each filter value from OM relationships.
    But am at a loss as to how to create new filter values in this table. Would anybody be in a position to advise?
    Thanks in advance.
    Example scenario:
    Every appraisee has three appraisers: MANAGER, BUSINESS AREA GENERAL MANAGER (BAGM) and DOTTED-LINE MANAGER (DLM). There is no unified logic in the existing OM structure to identify the BAGM other than to create a custom relationship between all child org units and the position of the BAGM.
    I need to name all three participants as appraisers in the appraisal category - but the only way I can name multiple persons as appraiser is to provide a selection ID at the category level (the selection ID being the filter value picked up from table T77HAP_FLT_SEL). For this, I would need to create values for BAGM and DLM in T77HAP_FLT_SEL so that I can pick them up when configuring my category.

    Thanks Dilek,
    That was the first thing I had tried. However, there is no maintenance dialog for T77HAP_FLT_SEL in transaction SM30 - the error says no maintenance objects exist for this table/view.
    From my research so far, it looks like the selection ID/filter value is picked up by BADI HRHAP00_SELECTION. But am not sure if the same BADI is used to populate new values in this table or not.

  • JFileChooser, how can you allow the user to select MORE than 1 file?

    Hello everyone.
    I want to allow the user to select multiple files from a directory, not just 1, but not just the whole directory.
    Currently I see these 2 options from looking at the sun's JFileChooser demo:
    //Create a file chooser
            fc = new JFileChooser();
            //Uncomment one of the following lines to try a different
            //file selection mode.  The first allows just directories
            //to be selected (and, at least in the Java look and feel,
            //shown).  The second allows both files and directories
            //to be selected.  If you leave these lines commented out,
            //then the default mode (FILES_ONLY) will be used.
            //fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);but both don't allow the selection of more than 1 file.
    When I say, select more than 1 file I mean the user can hold in SHIFT or CTRL and select files.
    Any ideas how to do this?
    Thanks!

    http://java.sun.com/javase/6/docs/api/javax/swing/JFileChooser.html#setMultiSelectionEnabled(boolean)
    Cheers,
    Laird

  • Photos that have been deleted to aperture trash cannot be viewed. Any assistance is welcome in fixing this bug. The showing all files option is selected in the filter. System is 10.8.4, aperture version 3.4.5

    Photos that have been deleted to aperture trash cannot be viewed. Any assistance is welcome in fixing this bug. The showing all files option is selected in the filter. System is 10.8.4. Aperture version 3.4.5. Used to be able to view the files then all of a sudden they have stop appearing. Once the aperture trash is emptied the files can be viewed in the system trash. Becomes quite annoying if you want to review the aperture trash files before deletion.

    Photos that have been deleted to aperture trash cannot be viewed  ...
    The showing all files option is selected in the filter.
    Cookiemonster, previously Frank Caggiano's magic helped in this situation - have you tried the double, double Caggiano as described here?
        Images not appearing in browser, search filter is cleared
    https://discussions.apple.com/docs/DOC-3062
    In the most recent version I cannot get this trick to work, however. But try it anyway, maybe it is just my macthat has an issue.
    Did this happen directly after the update? Where is your library located, on an external or an internal drive? Are your originals managed or referenced?
    I'd try next to check, if this is caused by the library, by creating a small test library and trying to trash pictures there. If it works well in a new library try to repair the database and the permissions on your regular library.  See:
    http://documentation.apple.com/en/aperture/usermanual/index.html#chapter=27%26se ction=10%26tasks=true
    Regards
    Léonie

  • I recently upgraded to 10.6.7 and Safari 5.05. Safari now has a long load time when you initially boot it up and when selecting a new tab. Other than that it works fine. What can I do ?

    I recently upgraded to 10.6.7 and Safari 5.05. Safari now has a long load time when you initially boot it up and when selecting a new tab. Other than that it works fine. What can I do ?

    Check Safari / Preferences - Extensions. If you have any installed, turn that off, relaunch Safari.
    If it's not Extensions, check for third party Safari add ons.
    http://support.apple.com/kb/TS3230?viewlocale=en_US

Maybe you are looking for