MAC leopard:  JFileChooser not using FileFiler correctly!?

Hi guys,
I am using FileFilter to filter files with extension ".fpp" in my JFileChooser.This works well in Windows.But in MAC , it shows the "application" files.
I mean there are some files with ".app" extension and they are shown in JFileChooser.So what i did was, using texteditor ; created an empty text file and rename its extension into ".app" ,but then this file did not get displayed in JFileChooser! So seems ,since MAC does not recognise file by its extension ,but by content its showing these "application" files.But I am wondering why it shows this "application" files !! ?
Is there a way to hide these "application" files in JFileChooser ?
Regards

Can't you write your own FileFilter(s) that specifically don't display a directory if it ends in ".app"?
import java.io.File;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
public class JFileChooserTest {
     public static void main(String[] args) {
          JFileChooser chooser = new JFileChooser();
          chooser.setFileFilter(new FileFilter() {
               public boolean accept(File f) {
                    if (f.isDirectory()) {
                         if (f.getName().endsWith(".app")) {
                         //if (f.getName().toLowerCase().startsWith("d")) {
                              return false;
                         return true;
                    // Replace this with whatever logic is appropriate.
                    return f.getName().toLowerCase().endsWith(".exe");
               public String getDescription() {
                    return "Executable files (*.exe)";
          chooser.showOpenDialog(null);
}

Similar Messages

  • I have a jetpack, and when I try to "connect" to my ipad or phone, it keeps telling me I am not using the correct password.  I have tried everything.  I even changed the password, nothing is working.  Both are 4G, my ipad is an Air and my phone is a Iphon

    I have a jetpack, and when I try to "connect" to my ipad or phone, it keeps telling me I am not using the correct password.  I have tried everything.  I even changed the password, nothing is working.  Both are 4G, my ipad is an Air and my phone is a Iphone 5.  I can get connected to other wifi on these features but not with my jetpack.  Please help, I need to use this feature soon.  Thank you so much

    Chances are you mis-typed a character in the Wifi password and the devices saved that information.  Now whenever you try to connect the device refers to the wrong password and the Jetpack does not accept your connection.  Tell your devices to forget the wireless connection and start over.
    Once you enter the proper WiFi credentials the Jetpack will allow you to connect.

  • 'You Are Not Using The Correct Type of Phone Cord' Error

    Having a issue with my fax on my HP Officejet Pro 8500 wireless.  Tried to send a fax, it  received a send error.  I ran fax test and it came back with "You are not using the correct type of phone cord".  Nothing has changed since I last fax'd but I check the lines and connection, everything appears ok.  Phone jack is connected to 1-line and Officejet '2-ext' is connected to the phone.  I use a dedicated phone # and the Officejet is set to auto answer.   I can call out and receive calls on the phone connect to the Officejet.  My assumption is that since I can use the phone without issue there is nothing wrong with the phone line.  Any ideas?
    This question was solved.
    View Solution.

    I was having the same problem.  I'm using a the 2 wire phone cord provided with the printer and still getting this error.  Turns out that it related to have a phone extension plugged into the printer.  If I unplug the telephone form the extension jack on the back of the printer, then the fax test passes.   I was even using a 2 wire cord on the phone extension but it seems that simply having a telephone plugged into the extension jack will cause this error. 
    Run the test without a telephone plugged into the printer's extension jack and you should be fine.
    Worked for me!

  • Mac users DO NOT use this Desktop software! it will cause hours of heartache

    I have exactly the same issue with a Bold and have still to find any option to resolve the issue other than to entirely wipe the device and go through the tiresome process of reinstalling and updating everything to the way i had it.
    I am utterly furious with myself for trusting RIM to release a desktop option for Mac users. I choose a Blackberry for its push email and i love the device very much, even despite Initially going through 6 Bolds until i received a new one from Vodafone UK that was not reconditioned and finally worked properly. Since then everything has been fine until this amateur attempt at writing software for Mac users.
    I don't have a lot of time to myself and i can think of nothing worse than spending the little time i have searching through endless ill concieved solutions that simply do not work. Just by plugging in my Bold and hitting sync has destroyed my contacts, ringtones and other settings. Why bother to release software until it is entirely tested? Why would you want to put your customers through this demorolising procedure which does nothing more than further emphasise your true lack of interest in supporting anything Mac. I dont want an iphone, i believe that your phones aresuperior for business users like myself.
    Please, please, if you are a Mac user DO NOT use this software unless you really want to go through hell just trying to get it back to the customised form you spent loving hours to get right. It destroys your address book and other elements and not one solution posted anywhere on the Blackberry web site works. YOU HAVE BEEN WARNED.
    The reason i am a Mac users is because i need a reliable hardware/software solution that works out of the box. It is entirely obvious that RIM havent quite realised the long term benefits of this really very simple idea!

    thecount wrote:
    well, I attempted to use it, but I initially just tried syncing just the tasks and it would not do that!  so I gave up and uninstalled.  
    I now have been trying to sync with pockmac but that also has issues.
    Only reason I am not going to get an iphone, is that I really need to sync with entourage and I use notes on it extensively. and I don't think you can sync an iphone with entourage notes?
    can't win can we?
    this was one reason i've been sticking with the blackberry as well. it appears though that now you can... http://support.apple.com/kb/HT1670
    i really have liked my blackberry, and have been waiting for this software for some time now, but if this is rims idea of a client i have no choice but to go to the iphone...

  • HT1349 my mac installer will not accept my correct password despite changing it to ensure i was using the right one  I am trying to download microsoft office

    I am trying to install microsoft suite on my macbook pro.  the installer program will not accept my password. what am i doing wrong
    i changed my apple password and my microsoft password to make sure that i was using the correct password and the system will still not accept the password
    HELP

    You don't need an Adobe password to download Adobe Reader.  However, during the installation you may be prompted you for your system's Administrator password.
    See https://forums.adobe.com/thread/1619850

  • Mail not using the correct account to reply to email

    I use Gmail to fetch email from my other email accounts. Prior to Mountain Lion, whenever I replied to an email, Mail would use the correct email account to reply to. That is to say, Gmail was fetching email from [email protected], for example. When I click reply, the default account would be mail.com. But since upgrading to Mountain Lion, the default account will be Gmail.com.
    Has anyone experienced this? How were you able to solve this, if at all?
    Thanks in advance for your responses.

    The new rule seems to be if you move an email message received on account A to a folder belonging to account B, that means the message now "belongs to" account B, and replies will come from account B. The new rule is murkier if you move a message from account A to an "On My Mac" folder and then reply to it.
    I'm not saying that I like it that way, or that Apple has documented the change, just that this "new rule" seems to explain many of the "wrong reply" and "copying myself" complaints we see here on the forums. If we (users) can figure out the second half of the "new rule" ("On My Mac" folders), we might be able to explain the rest, we might be able to predict how replies will work, and we might be able to write a cogent complaint about the "new rule."

  • New MackBook Pro and now I got an iPad 2. I had an iTunes acc opened on another Mac that had not used it in a long time. Now I need to get APPS but not permitted on this Mac (authorization to write on iTunes Media ?)

    Need assitance to obtain permission to download APPS for my iPad through my MacBook Pro that for some reason iTunes is not allowing to do, I get message like "this computer doesn't have authorization to write on ITunes Media.
    I have had the iTunes account for a long time but hardly used, never on this computer (new).

    If you have been using the mac.com Apple ID to make iTunes purchases recently, then there should be no issues continuing to use it with the new iPhone. I would abandon the new ID as you will never get Apple to merge the two IDs. I have had a mac.com ID for years and continue to use it with my iPhone 4S.
    Tell us the issues that you encounter trying to set up the iPhone with the mac.com account.

  • I am running a MAC PRO 10.6.8 and it has firefox 3.6.1.3 and it shows no updatres available? My MAC Book PRo has updated to 6.0.2. can I manually update my MAC PRO to 6.0.2 or is there a reason the MAC PRO should NOT use 6.0.2?

    see question above

    I am in my late 60's so I can't imagine all the changes and questions to what to do but... new Macs do not boot from an OS the pre-dates it.
    The Mac Pro is 7.5 yrs old , I have the August 2006 1,1 right here right now.
    Sounds like we have the same system - Mac Pro 1,1 2.66 dual/dual-core (total of 4-cores) DDR2 FB-DIMMs et c.
    These cannot run Mountain Lion 10.8.x
    The PowerMac G5 came out in Sept/Oct 2003 and shipping with10.3.0/
    I would do a clean install. Than install all apps from scratch.
    Upgrade CS5 first ahead of time if you want Migration or Setup Assistant.
    Clone your system:
    How to Clone a Volume
    Using Cloning as a Backup Strategy 
    See also Erasing a Drive, How and Why to Partition a Drive, RAID.
    http://www.macupdate.com/app/mac/7032/carbon-copy-cloner
    Using Cloning as a Backup Strategy
    http://macperformanceguide.com/Mac-HowToClone.html
    Sorry you felt the need to start a new thread.
    No need to single out and title a thread with anyone's name.

  • Mac Preview does not save PDFs correctly

    When I try to save a webpage as a PDF using the Print dialog box on my Mac, ("Save as PDF"), the PDF is distorted. The first page is OK but on the second page, the text displays in a larger font and the text is cut off on the right. Apple tech says this is a browser problem, as it does not happen with Safari.

    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback

  • Nvidia binary driver: can not use color correction.

    hey,
    When using nvidia-settings, I can not change brightness, contrast and gamma in the Xserver Color Correction. I change the values but the display directly goes back to the default configuration.
    anyone experienced the same?
    Linux kalak 2.6.37-ARCH #1 SMP PREEMPT Tue Mar 15 09:21:17 CET 2011 x86_64
    nvidia 260.19.44-1
    xorg-server 1.9.4.901-1

    hey,
    When using nvidia-settings, I can not change brightness, contrast and gamma in the Xserver Color Correction. I change the values but the display directly goes back to the default configuration.
    anyone experienced the same?
    Linux kalak 2.6.37-ARCH #1 SMP PREEMPT Tue Mar 15 09:21:17 CET 2011 x86_64
    nvidia 260.19.44-1
    xorg-server 1.9.4.901-1

  • Mac for Lync not syncing the correct presence

    I have Lync for Mac 2011 version 14.0.9 installed and it is not updating my presence properly based on my Outlook Calendar. I have Office installed on the Mac and the two don't sync. If I run Lync on a Windows machine while the Mac client is running, the
    Mac client's presence will change. As soon as I log out of the Windows client the Mac client reverts back to "Available."
    I have set Lync for Mac to update my presence based on my Exchange information.

    On windows Lync Client using the configuration information http://technet.microsoft.com/en-us/library/gg195661(v=ocs.14).aspx
    Does EWS status say OK 
    Please remember, if you see a post that helped you please click ;Vote As Helpful" and if it answered your question please click "Mark As Answer" Regards Edwin Anthony Joseph

  • I just installed a new Hard drive in my MAC I can not use my Adobe product now. Says its not compatable with my software. But it was working fine before my hard drive crash

    I can not uninstall the software either, I already tried that. When I click on the "add or remove" software, it automaticly thinks I'm trying to install it and says I cant install??

    Thanks again kglad. I have walked through several of these and no results. When I launch InDesign in gives me the "Licensing has stopped working" But that is the only program. The rest tell me I may need to uninstall and reinstall the programs. They wont even try to start up. I believe the problem started when I tried to use the CC Cleaner tool. I believe it deleted something. It now gives me an error message:
    The alias “Add or Remove Adobe Creative Suite 3 Design Premium” can’t be opened because the original item can’t be found.
    When I try to open the Add or remove Adobe Creative Suite. So now at this point it seems I cant even "Uninstall" my software? Is that right? Sorry I'm pretty dumb with the whole computer thing really
    Thanks again

  • BUG in IMS 5.2 P 1 on Windows 2000 : not using the correct DNS servers

    Hi everyone,
    I encountered a queer bug in Ims 5.2 on Windows 2000.
    Let me explain it to all of you to avoid spending time and money debugging this problem.
    The problem may occur on Windows 2000 Server if the server used was formerly configured to obtain its IP address from a DHCP server (before using it for mail purposes).
    Windows 2000 doesn't delete its DHCP client configuration even if the machine is re-configured with a static IP.
    It stores the information in an interface registry key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
    If you install IMS52 after this, the server will use the DNS servers configured in the DHCP configuration rather than the ones specified in the static IP config to lookup the MXs.
    So if the nameservers configured in the DHCP config are not reachable, the smtp server will systematically fail sending outbond mails.
    To avoid this, locate the DHCP interface key in the Registry and remove it.
    Remarks :
    I know that this situation is not common but it may occur in certain occasions for people like me who are making demonstrations on clients sites.
    I'm not sure it is specifically related to DHCP rather than static config. I would say that IMS uses the first interface found in the registry (in alphabetical order) even if this interface is not active...
    A good idea is to remove completely from the registry all the interfaces keys not currently used by the system.
    Hope this will help some of you.
    Best regards,
    Vincent MAZARD
    DML FRANCE

    Interesting. Thank you for the observation. Not something I have seen, either.

  • I did instal Firefox 4 to my G5 Mac and can not use it, how do I remove it, deinstall it.

    I downloaded Firefox 4 to my G5 Mac, 1.8 GHz PowerPC, Mac Version 10.5.8, cannot use it. Want to know how do I deinstall it. I have the Firefox 2CD, can I use this to deinstall.
    Thank you, Georgia Simms

    Unfortunately, Firefox 4 supports only Mac OS X 10.5 and above on Intel hardware. The system that you are currently using is no longer supported by Firefox (details can be found [http://www.mozilla.com/en-US/firefox/system-requirements.html here)].
    <BR><BR>You can revert back to previous version of Firefox by following these steps:
    # Open the Applications folder.
    # Drag the Firefox application to the Trash.
    # Download and install Firefox 3.6 from [http://www.mozilla.com/en-US/firefox/all-older.html here].

  • Fmt:message not using the correct locale

    Hello,
    I have a webapp which uses struts and jstl. I use the following code snipped to display localized strings
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
    <%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el"%>
    <fmt:message key="label.help"/>
    My resource file is specified in struts-config.xml as follows:
    <message-resources parameter="com.ibm.psdui.resources.PSDText"/>
    I currently have the base file PSDText.properties and a German version PSDText.properties_de.
    If I have the language setting in my browser to de, I see the German strings. However if I set the languages to en-us followed by German, I still see the German strings. It seems like fmt:message is using the wrong locale. Just out of curiosity I replaced fmt:message to bean:message and I see the right localized strings. I have to use fmt:message. Am I missing some configuration setting or something?
    Thanks in advance,
    Kumar

    BTW... fmt doesn't support Struts, that I'm aware of... it's a JSTL tag library. So it probably does what I said because I'm not sure that java.util.ResourceBundle will load the default bundle for it... or maybe it does (I forget) but it could be just looking for properties files on it's own. So I don't think that setting message-resources in the Struts config file is going to make a difference if you aren't using the bean taglib.

Maybe you are looking for