Windows L&F JFileChooser

My entire application needs to use the Metal L&F
except for the JFileChooser.
How can I create a JFileChooser using the Windows
L&F, while leaving the L&F for the other parts of
my app the same?

That's simple. However, it looks horrible. Simply switch to windows LAF prior to opening your JFileChooser and switch back when you are done.
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
JFileChooser jfc = new JFileChooser("C:\\");     
int returnVal = jfc.showOpenDialog(this);
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MetalLookAndFeel");

Similar Messages

  • Grey rect when another window cover my panel

    Hello, maybe this is a stupid question but I really don't know how
    to fix it, I'm new to graphic interfaces.
    I have a Graphics object on a JPanel and works properly, but
    when I open a window on it, a grey rect remain on the screen.
    It happends with every kind of windows, even with JFileChooser.
    I initialize my Graphics object like this:
    g=(Graphics2D)imgPanel.getGraphics();
    and then draw an image on it:
    imgName=filechooser.getSelectedFile().getAbsolutePath();
    BufferedImage img = javax.imageio.ImageIO.read(new File(imgName));
    g.drawImage(img, 0, 0, imgPanel);
    When the filechooser close a grey spot remain on it, or if
    I minimize and then re-open my frame everything's grey on imgPanel.
    If i call imgPanel.repaint() everything turns grey.
    Is there something with this? Is there a trick to fix it?
    I'm using jdk6:
    $ java -version
    java version "1.6.0"
    Java(TM) SE Runtime Environment (build 1.6.0-b105)
    Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
    but I've also tried using th old jdk5, both on WindowsXP and Kubuntu7.04, and nothing changed.
    I read about this bug:
    http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=7400c332c6613ffffffffc6ae0f9844a8a43?bug_id=5104569
    but it seems to be fixed and I use an earlier version of jdk.
    Can someone help?
    Edited by: lilyhamlin on Oct 6, 2007 11:01 AM

    I'm having exactly the same problem. I want to create Graphics for a game.
    Reading the above, I understood that the Component must be fully repainted everytime we want to change something. Is that right?
    Can we then use Graphics on an Image as a solution? We can change the graphics on an image and then paint the whole image again and again in the component. In the following example every click in the button changes the Image's Graphics and repaints the Image on the Componet. Looks to me pretty nice, isn't it?
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Toolkit;
    import java.awt.image.BufferedImage;
    class Testing
      String message = "Hello World";
      Image image;
      Graphics geg;
      int i=150;
      int j=50;
      public void buildGUI()
        final JPanel p1 = new JPanel(){
          public void paintComponent(Graphics g){
            super.paintComponent(g);
            g.drawImage(image,20,20,this);
        p1.setPreferredSize(new Dimension(200,100));
        final JButton tf = new JButton();
        JFrame f = new JFrame();
        f.getContentPane().add(p1,BorderLayout.NORTH);
        f.getContentPane().add(tf,BorderLayout.SOUTH);
        f.pack();
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
        image = p1.createImage(150,50);
        geg=image.getGraphics();
        geg.setColor(Color.black);
        tf.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            geg.drawLine(i,j,i,j);
            i=i-1;
            j=i/3;
            p1.repaint();
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }Edited by: GeorgiosSfiris on Oct 10, 2007 1:11 PM

  • How to control JFrame hierarchy?

    I'm building an application with a GUI similar to Adobe Photoshop, where the main window frame always stays in the back and other "child" windows float on top of it. But, I currently cannot make all my windows from JFrame because I can't find a way to make the main JFrame stay in the back and always be visible while keeping its child windows on top of it, whether or not the main JFrame has the focus. Does anyone have a solution? Is there a way to control the window hierarchy, if there is one?
    I tried an alternative method where the main frame is a JFrame, and the child frames are JInternalFrames contained within the JFrame. But, I've ruled this option out because JInternalFrame has a lot of problems with painting, especially if a JInternalFrame is displaying a large image. The painting is too slow and unacceptable. It is very fast if the child windows are JFrame or JDialog, but as mentioned before, I need to keep the main frame in the back and always visible. Also, I won't be able to mix in other non-internal window objects, like JFileChooser (unless I make my own file chooser class, which I do not want to do).
    I could make the child windows be JDialog objects whose parent is the main JFrame, and that way they would stay above the main frame, whether or not the dialogs are modal. But, I can't make the child windows all JDialog objects because JDialog only has the "close" button on the top right, where I still need the "minimize" and "maximize" buttons there, too.
    Can anyone help me out here? Thanks in advance.

    hi vwizard,
    I'm trying to do the same thing you were asking about in this post. I know it's been over a year ago but did you come up with a suitable solution? If so I would greatly appreciate the advice.
    To recap: I would like a parent JFrame that's always visible in the background, and a child JFrame in the foreground.
    thanks

  • Problems with JFileChooser and Windows 2000 (can't see mydocuments contents

    Hi! I've an applet which has a JFileChooser component. In other Windows, I can select the MyDocuments folder and it goes there and list all the contents OK. But, in Windows 2000, when I go to MyDocuments, none of the contents is listed in the file chooser. I need to navigate through all the directories to get there (C:\documents and settings\user\my documents) and then, it shows its contents, but obviously, I don't want it to be this way because is difficult for the common user.
    Any idea of why is going on this?
    Thanks in advance!

    Hello, You need to use something like o=isp as the
    root DN, then o=yourorg.com goes beneath it.
    i.e.
    For the other questions on setup, just choose o=isp
    as base DN when you set up the directory server. When
    you run ims_dssetup.pl, choose o=internet as the DC
    tree base, then choose o=isp as the user/groups base
    suffix.
    When you are installing messaging server it will ask
    where to put the default organization, this is where
    you would choose o=abc.com, o=isp
    For more info on how this structure works please take
    a look at this link and it will all fit into place:
    http://docs.sun.com/source/816-6017-10/changes.htm#170
    8Alright, I got ims_dssetup to run successfully. But now when the ims 5.2 installation is about 50% done, I get the message:
    A serious problem occurred while installing the iPlanet Messaging Server Messaging SIE entry in LDAP (msg.cfgldap.sie.inf). It reported the following problem:
    The server configuration for the Messaging SIE entry in LDAP (msg.cfgldap.sie.inf) cannot be created.

  • JFileChooser problem with Windows Vista

    Hi,
    I running into the following problem.
    I am using JFileChooser in some of the JInternalFrames in my application. When I using Windows XP everthing works perfectly.
    Now Here is the issues, I have a new user using the application. His computer is Windows Vista and the error comes when I am using JFileChooser.
    I need to know I need to put another file or update ANYTHING ON WINDOWS VISTA FOR THIS JFileChooser to work.
    I appreacite your help and time.
    Wilfer
    CDC

    That's not an error from Java, as far as I know. Something else is producing it. Look over these search results for a case that matches what you see:
    http://www.google.com/search?q=error+31849

  • Jfilechooser - problem with windows mapped dirs

    My Documents, Desktop and other windows mapped directories
    or network drives cause performance problems for the java file
    chooser class.
    I think because the file chooser has to resolve
    ambiguous paths for each file.
    i.e.
    1. Desktop\My Documents\myfile.doc
    2. c:\documents and settings\me\My Documents\myfile.doc
    3. Desktop\My Computer\c:\documents and settings\me\desktop
    4. Desktop\My Computer\c:\documents and settings\me\my
    documents\myfile.doc
    Most of our users are using xp and save most of their
    files to the My Documents directory.
    I need to find some work around. If this is not possible
    I could do with some tips on writing a directory service
    that will perform better on windows architecture.
    regards,
    Paul Cunningham

    It's still a serious problem. I am using WinXP with java 1.4.1_01. A folder on a mapped network drive with about 450 files in it takes an enormous amount of time to open & display. Once the file icons appear in the JFileChooser, scrolling and selecting in the JFileChooser is horrendously unresponsive.
    This problem (or related ones) seems to have been around for a long time. I wonder why it doesn't get fixed?
    - Dave P. -

  • File Chooser--not JFileChooser, but WIndows style

    I once saw in a Java program a file opener that didn't use the less-than-perfect JFileChooser, but rather the standard Windows file opener. Anyone know how to do this, what it was?

    And it relies on native code, so it's not even
    cross-platform anymore, so I just went back to
    JFileChooser.Well, you did ask for the "standard Windows file opener".

  • Need to browse solaris directory structure through windows (JFileChooser).

    Is there any way or any external API exist through which we can access the solaris/unix directory structure from windows through JFileChooser.

    johndjr wrote:
    I assumed it did and then and it wasn't until after you asked that I questioned my self as to whether I knew that or I just thought I knew it. After a brief check it seems that it does
    [some anecdotal evidence|http://wikis.sun.com/display/BigAdmin/Enabling+Browsing+with+Samba+in+Solaris+10+Update+4]
    I lucked out this time.Nifty - thanks for the link!

  • How JFileChooser finds the Desktop and can browse CIFS(SMB) in windows.

    Hello.
    I'm currently using serveral methods from FileSystemView used by JFileChooser to detect if a File is a system root, a floppy, or to find the "My Documents" folder under windows.
    JFileChooser however is also able to provide a link to the desktop. How do I get that location from Java?
    Further more. JFileChooser is able to browse and use resources located on the network using CIFS(SMB). I've searched through JFileChoosers source. But I can't figure out how it does this.
    I'm currently writing a Folder synchronization app. As you can see in the screenshot ( http://users.telenet.be/greenhouse/Screenshot-7.png ) I'm trying to integrate the location browser (Look based on the GTK file browser) more into windows. I want my users to be able to browse CIFS just like in the JFileChooser. How do I do this?
    The reason I'm writing my own browser is because the GTK one provided in Java is more then lacking. And I can provide browsing for remote resources more easily (like SFTP and SCP)
    In short:
    *JFileChooser however is also able to provide a link to the desktop. How do I get that location from Java?
    *JFileChooser browses and uses CIFS in windows. How do I do this (without a 3th party library) the same way as JFileChooser does it?
    Message was edited by:
    finalbeta

    JFileChooser fr = new javax.swing.JFileChooser();
            FileSystemView fw=fr.getFileSystemView();
            defaultfolder = fw.getDefaultDirectory().getPath();
           String desktopfolder;
            if(System.getProperty("os.name").startsWith("Windows")){
                for(File tmp:fw.getRoots()){
                    dekstopfolder = tmp.getPath();
            }That piece of code gives the path to the desktop folder in Windows. In linux it returns root. (getRoots();) How horrible.
    I hope I'm going about this the wrong way. Because this would be an ugly Java API.

  • How get JFileChooser stay in front of browser window?

    As an alternative to using HTML (<input type=file>) on the client to take care of browsing local files, I want to use a Java swing component (coded in a servlet) to do the same thing, in order to customize text on buttons, etc. JFileChooser works just fine, if it wasn't for the fact that it time and again disappears behind the web browser (Internet Explorer) window (and I have to minimize the browser window to see it). In contrast to a Java Window object, JFileChooser cannot be set so that it always stays on top of the web browser window.
    Therefore, the solution seems to be to build my own JFileChooser-look-alike file browser (OK, I am NOT talking about the web browser now), based on a Java Window object. Is this possible? In other words, what methods or classes can I use to create the viewing of local files? Any other comments or ideas?

    Hi Sannie,
    change the order of the plots. Your RunAvg should be plot0, while the barplot is plot1…
    There's a reason, why BMPs are banned in the forum: their size! Please convert your images to (real) JPG or (even better for FP or BD images) PNG before posting them!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • JFileChooser DFS and Windows Vista Service Pack 2

    We updated a computer with Vista Service Pack 2 and now JFileChooser is not opening up links that are DFS.
    To make sure it was not our app I tried using the JFileChooser Demo from Sun and I am still having the same issue. Java will allow me to quick but it will fail silently.
    I have retried using the latest 1.6.0_14 (6u14) JDK and JRE but still no luck (Which says support Windows Vista SP2). Is there a bug with the JRE? We have reverted the computer to SP1 and are alerting our user base.
    Is anyone else having this issue? Do I need to report it as a bug?
    Anyone have a suggestion?
    Thanks,
    pk

    I have verified that this does not work with Windows 7

  • JFileChooser functioning like normal Windows Apps FileChooser

    I have this problem that's been giving me too much headache already. When you click on Open on any Windows app, and click on the "Details" button, it will show you the files' details (FileName, Type, Date, etc.). This is the same with JFileChooser, so no problem there. The thing is, with Windows apps, you can click on the headers and have the files sorted according to the header you clicked. This doesn't happen to a JFileChooser. Has any of you guys did this or found any solution to this problem? I've searched (almost) everywhere, Google, Sun, etc., I even looked into JFileChooser's source code but I can't seem to find anything.
    I know this is possible, so anyone who can help, you'll be greatly appreciated.

    Thought I would pass along some updated code for this as this was very helpful to us as we are still on jdk 1.5.
    This has been modified to use the Windows UI. The advantage of doing this in the UI class is so you can set it as the default UI for JFileChooser inside your application. If you had this as a subclass of JFileChooser (as it is above) then you explicitly have to use that subclass throughout your application. By setting this UI class as the FileChooserUI in your UIDefaults table then every instance of JFileChooser will now automatically use your overridden UI and theres nothing else you have to do.
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.io.File;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.Vector;
    import javax.swing.JComponent;
    import javax.swing.JFileChooser;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    import javax.swing.UIManager;
    import javax.swing.plaf.ComponentUI;
    import javax.swing.plaf.basic.BasicDirectoryModel;
    import javax.swing.table.JTableHeader;
    import javax.swing.table.TableColumn;
    import javax.swing.table.TableColumnModel;
    import com.sun.java.swing.plaf.windows.WindowsFileChooserUI;
    public class SortableFileChooserUI extends WindowsFileChooserUI {
         private DirectoryModel model;
         public static ComponentUI createUI(JComponent c) {
              return new SortableFileChooserUI((JFileChooser)c);
         public SortableFileChooserUI(JFileChooser filechooser) {
              super(filechooser);
         @Override
      protected final void createModel() {
              this.model = new DirectoryModel(getFileChooser());
          * Overridden to get our own model
          * @return
         @Override
      public final BasicDirectoryModel getModel() {
              return this.model;
          * Calls the default method then adds a MouseListener to the JTable
          * @param chooser
          * @return
         @Override
      protected final JPanel createDetailsView(JFileChooser chooser) {
              JPanel panel = super.createDetailsView(chooser);
              //Since we can't access FileChooserUI's private member detailsTable
              //directly, we have to find it in the JPanel
              final JTable tbl = findJTable(panel.getComponents());
              if (tbl != null) {
                   //Fix the columns so they can't be rearranged, if we don't do this
                   //we would need to keep track when each column is moved
                   tbl.getTableHeader().setReorderingAllowed(false);
                   //Add a mouselistener to listen for clicks on column headers
                   tbl.getTableHeader().addMouseListener(new MouseAdapter() {
                        @Override
            public void mouseClicked(MouseEvent e) {
                             //Only process single clicks
                             if (e.getClickCount() > 1) {
                return;
                             e.consume();
                             Column column = Column.getColumn(tbl.getTableHeader().columnAtPoint(e.getPoint()));
                             if ((column != null) && column.isSortable()) {
                SortableFileChooserUI.this.model.sort(tbl.getTableHeader().columnAtPoint(e.getPoint()), tbl);
              return panel;
          * Finds the JTable in the panel so we can add MouseListener
          * @param comp
          * @return
         private final JTable findJTable(Component[] comp) {
              for (int i = 0; i < comp.length; i++) {
                   if (comp[i] instanceof JTable) {
                        return (JTable)comp;
                   if (comp[i] instanceof Container) {
                        JTable tbl = findJTable(((Container)comp[i]).getComponents());
                        if (tbl != null) {
    return tbl;
              return null;
         private final static class DirectoryModel extends BasicDirectoryModel {
              private Column col = Column.FILENAME;
              private boolean ascending;
              private Comparator<File> filesizeComparator = new FilesizeComparator();
              private Comparator<File> filenameComparator = new FilenameComparator();
              private Comparator<File> filedateComparator = new FiledateComparator();
              * Must be overridden to extend BasicDirectoryModel
              * @param chooser
              protected DirectoryModel(JFileChooser chooser) {
                   super(chooser);
              * Resorts the JFileChooser table based on new column
              * @param c
              protected final void sort(int c, JTable tbl) {
                   //Set column and order
                   this.col = Column.getColumn(c);
                   this.ascending = !this.ascending;
                   String indicator = " ^";
                   if (this.ascending) {
                        indicator = " v";
                   final JTableHeader th = tbl.getTableHeader();
                   final TableColumnModel tcm = th.getColumnModel();
                   for (Column column : Column.values()) {
                        tcm.getColumn(column.getIndex()).setHeaderValue(column.getLabel());
                   final TableColumn tc = tcm.getColumn(this.col.getIndex()); // the column to change
                   tc.setHeaderValue(this.col.getLabel() + indicator);
                   th.repaint();
                   //Requery the file listing
                   validateFileCache();
              * Sorts the data based on current column setting
              * @param data
              @Override
    protected final void sort(Vector<? extends File> data) {
                   Comparator<File> comparator = null;
                   switch (this.col) {
                        case FILEDATE:
                             comparator = this.filedateComparator;
                             break;
                        case FILESIZE:
                             comparator = this.filesizeComparator;
                             break;
                        case FILENAME:
                             comparator = this.filenameComparator;
                             break;
                        default:
                             comparator = null;
                             break;
                   if (comparator != null) {
                        Collections.sort(data, comparator);
              private class FiledateComparator implements Comparator<File> {
                   public int compare(File a, File b) {
                        int ret = 1;
                        if (a.lastModified() > b.lastModified()) {
                             ret = -1;
                        else if (a.lastModified() == b.lastModified()) {
                             ret = 0;
                        if (DirectoryModel.this.ascending) {
                             ret *= -1;
                        return ret;
              private class FilesizeComparator implements Comparator<File> {
                   public int compare(File a, File b) {
                        int ret = 1;
                        if (a.length() > b.length()) {
                             ret = -1;
                        else if (a.length() == b.length()) {
                             ret = 0;
                        if (DirectoryModel.this.ascending) {
                             ret *= -1;
                        return ret;
              private class FilenameComparator implements Comparator<File> {
                   public int compare(File a, File b) {
                        if (DirectoryModel.this.ascending) {
                             return a.getName().compareToIgnoreCase(b.getName());
                        else {
                             return -1 * a.getName().compareToIgnoreCase(b.getName());
         private enum Column {
              FILENAME(0, UIManager.getString("FileChooser.fileNameHeaderText"), true),
              FILESIZE(1, UIManager.getString("FileChooser.fileSizeHeaderText"), true),
              FILETYPE(2, UIManager.getString("FileChooser.fileTypeHeaderText")),
              FILEDATE(3, UIManager.getString("FileChooser.fileDateHeaderText"), true),
              FILEATTR(4, UIManager.getString("FileChooser.fileAttrHeaderText"));
              private int index;
              private String label;
              private boolean isSortable;
              private Column(int index, String label) {
                   this(index, label, false);
              private Column(int index, String label, boolean isSortable) {
                   this.index = index;
                   this.label = label;
                   this.isSortable = isSortable;
              protected int getIndex() { return this.index; }
              protected String getLabel() { return this.label; }
              protected boolean isSortable() { return this.isSortable; }
              @Override public String toString() { return getLabel(); }
              protected static Column getColumn(int index) {
                   for (Column column : values()) {
                        if (column.getIndex() == index) {
                             return column;
                   return null;

  • JFileChooser Problem (Extra Window)

    Hi, when i run my code i curently am getting an extra window when i press open or cancel in my GUI for my JFileChooser. below is an example of what im initializing.
        private void jbInit() throws Exception
        contentPane = (JPanel) getContentPane();
        contentPane.setLayout(xYLayout1);
        setSize(new Dimension(570, 307));
        setTitle("Open File");
        jFileChooser1.setMaximumSize(new Dimension(570, 307));
        jFileChooser1.setMinimumSize(new Dimension(570, 307));
        jFileChooser1.setPreferredSize(new Dimension(570, 307));
        contentPane.add(jFileChooser1, new XYConstraints(4, 0, -1, -1));
        jFileChooser1.addChoosableFileFilter(objectFilter);
        jFileChooser1.addChoosableFileFilter(textFilter);
        jFileChooser1.setMultiSelectionEnabled(false);
        jFileChooser1.setAcceptAllFileFilterUsed(false);
        int returnVal = jFileChooser1.showOpenDialog(this);
        //Figure out how to destroy the extra thing from below statement.
        if (returnVal == jFileChooser1.APPROVE_OPTION)
          selectedFile = jFileChooser1.getSelectedFile().getName();
          selectedDirectory = jFileChooser1.getCurrentDirectory().toString();
          if (true == textFilter.getSelected())
              setExtension("txt");
          if (true == objectFilter.getSelected())
              setExtension("obj");
        if (returnVal == jFileChooser1.CANCEL_OPTION)
          setExtension("Cancel");
        }If any more code is needed ask away.
    i really have no clue why the extra window is there i have tried this.dispose() and other things to try and get rid of it but nothing seems to work.
    Any help is greatly appreciated.

    We see no problems running your example code.
    import java.awt.*;
    import java.io.File;
    import javax.swing.filechooser.*;
    import javax.swing.*;
    // import com.borland.jbcl.layout.XYLayout;
    // import com.borland.jbcl.layout.*;
    public class OpenFrame extends JFrame{
    //  File file = new File("C:\\");
      File file = new File(".");
      JFileChooser jFileChooser1 = new JFileChooser(file);
      String selectedFile = null;
      String selectedDirectory = null;
    //  ObjectFilter objectFilter = new ObjectFilter();
      TextFilter textFilter = new TextFilter();
      JPanel contentPane;
      public OpenFrame(){
        try {
          setDefaultCloseOperation(DISPOSE_ON_CLOSE);
          jbInit();
        } catch (Exception exception) {
          exception.printStackTrace();
      private void jbInit() throws Exception{
        contentPane = (JPanel) getContentPane();
    //    contentPane.setLayout(xYLayout1);
        setSize(new Dimension(570, 307));
        setTitle("Open File");
        jFileChooser1.setMaximumSize(new Dimension(570, 307));
        jFileChooser1.setMinimumSize(new Dimension(570, 307));
        jFileChooser1.setPreferredSize(new Dimension(570, 307));
    //    contentPane.add(jFileChooser1, new XYConstraints(4, 0, -1, -1));
    // contentPane.add(jFileChooser1, BorderLayout.CENTER); // useless
        jFileChooser1.addChoosableFileFilter(textFilter);
        jFileChooser1.setMultiSelectionEnabled(false);
        jFileChooser1.setAcceptAllFileFilterUsed(false);
        int returnVal = jFileChooser1.showOpenDialog(this);
        if (returnVal == jFileChooser1.APPROVE_OPTION){
          selectedFile = jFileChooser1.getSelectedFile().getName();
          selectedDirectory = jFileChooser1.getCurrentDirectory().toString();
    System.out.println(selectedDirectory + "/" + selectedFile);
    System.exit(0);
    public static void main(String[] args){
      new OpenFrame();
    //The class for the textFilter.
    class TextFilter extends javax.swing.filechooser.FileFilter{
      public boolean accept(File f){
        return f.isDirectory() || f.getName().toLowerCase().endsWith(".txt");
      public String getDescription(){
        return ".txt files";
    }

  • JFileChooser and windows shortcuts (lnk files)

    Is there any way to get JFileChooser to follow windows shortcuts? I am using 1.4.1_01 on XP, which is full of "helpful" shortcuts to things like shared picture folders, etc, which JFileChooser chokes on.
    I would think Sun would implement support for the underlying lnk files, since this is an OS issue.

    Ok, I found a bug report for this, with a workaround hack. I'll post it here for anyone who is interested.
    http://developer.java.sun.com/developer/bugParade/bugs/4356160.html

  • Bug in JFileChooser (Java 1.6.0_03 running on Windows XP)?

    Hello All,
    I tried to display a JFileChooser dialog for file selection. It opens in the "My Documents" directory.
    This directory contained a big (400 megs) ZIP file.
    The JFileChooser dialog tooked a very long time to be displayed (I didn't selected this big zip file).
    If I remove the ZIP file, the JFIleChooser displays fast.
    I did the test with the JFileChooser demo from sun (http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html), and I find the same result.
    I think that's really a bug in the implementation of JFileChooser. Can you tell me if it is possible to let sun know this problem?
    Kind regards.
    Michael Hooreman

    JFileChooser has always had a problem with Windows XP's insistence on treating Zip files as folders. That's a stupid feature anyway, and I'm surprised JFileChooser doesn't automatically bypass it. You can disable the feature by running the following command: regsvr32 /u zipfldr Note that you'll be disabling the feature in Windows, not just in Java. You can re-enable it by running the same command without the /u.

Maybe you are looking for

  • HOW TO KEEP TEXT AT BOTTOM OF PAGE USING JAVASCRIPT-ANSWERED

    UPDATE 5/12/2006: MORE COMPATIBLE CODE: Was using OnRequestEnd.cfm to load copyright info at bottom of each page but page size varied and copyright info would appear at different points on different pages. Didn't look good. Could not use tables to al

  • I found out issue distinct clause in query ,refcursor not returning rows

    URGENT hi the following procedure returns records  but when i add  distinct clause to (open v_refcursor for select ) i.e   open v_refcursor for select distinct column1,column2   .......... in the procedure the procedure is not returning records. plea

  • Shift Abbreviations in Shift Planning

    Hello gurus, Anyone ever experienced this? i need to update It2003 with a period work schedule rule and not the Daily work schedule rule and it looks as though this is SAP STD that you can only work wirh DWS in shift planning. Anyone with some cranck

  • What is the need of ALE/ IDOC

    Hi All, What is the need of ALE/ IDoc and why we go for ALE?IDOC with conditions Let me know the answers if anyone have the solution Regards' Ramesh

  • Photoshop elements quits MAC

    I bought photoshop in december and I can load organizer but it quits after 2 minutes consistently, 100% of the time so I can't use the application.   It gives me the option to send a report to Adobe which I have done about 19 times but nothing happen