JFileChooser SetSelectedFile() bug

Hi,
I am having problems using a JFileChooser to save a file in JDK1.3.
The problem is that selecting a directory overwrites the filename in the file chooser, i.e. if a user types in a filename, then decides to change directories, their filename will be overwritten with the name of the directory they just navigated to.
This is a known bug, but I have been unable to find a solution where both:
a) the filename is NOT overwritten.
b) selecting the "save" button when a directory is selected OPENS the directory.
The solutions I have found so far solve a), but cause b) to stop working.
This has been resolved in 1.4.1 I think, but I need it to work with 1.3.
Has anyone got a solution, preferably one that isn't tied in to a particular look and feel?
Cheers.

Have you tried
   yourFileChooser.setFileSelectionMode(JFilesChooser.FILES_ONLY); ?

Similar Messages

  • Why does JFileChooser.setSelectedFile behave this way?

    Hello,
    I'm trying to ovverride the setSelectedFile() method. However in doing so I've discovered the following:
    Every user selection (single-click on a file/folder) results in two calls: one with the file null, and another with the selected file.
    Why??
    I could work around it, but i don't understand what sense it makes. I looked into JFileChooser code, and there doesn't seem to be an apparent 2nd call to setSelectedFile.
    This is my work around code. However having to say if (f != null) { and   if (!f.getName().equals("Dir")) { doesn't sound enough data hiding for me.
    class InstallDirChooser extends JFileChooser {
        @Override
        public void setSelectedFile(final File f) {
            if (f != null) {
                if (!f.getName().equals("Dir")) {
                    super.setSelectedFile(new File(f, "Dir"));
                } else {
                    super.setSelectedFile(f);
                System.out.println(getSelectedFile().getAbsolutePath());
    public class NewClass {
        public static void main(String[] args) {
            final InstallDirChooser c = new InstallDirChooser();
            c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            c.setSelectedFile(new File("Dir"));
            int rVal = c.showSaveDialog(null);
            if (rVal == JFileChooser.APPROVE_OPTION) {
                final File db = c.getSelectedFile();
                db.mkdir();
    }

    I'm not sure what you're trying to do here, but at
    first glance "TestK t = new TestK();" inside the for
    loop seemed unusual.
    If you place it before the loop it works fine.I guess what he is trying to ask is that why is that if you use the new operator in the code, you donot get the exception while if you dont use it you do get one. While in any case either you use it or not you are supposed to get a new String as per the String API.
    Well thats an interesting observation and I have no explanation as to why is this happening. I do remember that thread where somebody pointed this out as a use of the String(String original) construtor. Furtehr adding on to that the API states about this constructor the following
    Initializes a newly created String object so that it represents the same sequence of characters as the argument; in other words, the newly created string is a copy of the argument string.
    so I donot get why not using it would cause the exception to be thrown. I have tested the code though and it seems to behave as pointed in the original post.
    Interesting question though, food for thought.

  • JFileChooser - setSelectedFile doesn't work

    Hi,
    I'm using J2SE 1.4.1_01
    I want a suggested name to appear in the "File name" box when I use JFileChooser to save a file. I seem to remember this working fine with Java 1.3. I've seen it mentioned that I can use setText() on this, but don't understand how this can work. I've also tried explicitly setting the file as commented in my code
    This is my code....
    final JFileChooser fc = new JFileChooser();
    File outFile = new File("D:/EVA/Recombination/RATData/" + testSequence + ".csv");
    File dir = new File ("D:/EVA/Recombination/RATData");
    fc.setCurrentDirectory(dir);
    int returnVal = fc.showSaveDialog(null);
    if (returnVal == JFileChooser.APPROVE_OPTION)
    fc.setSelectedFile(outFile);
    /*also tried...
    fc.setSelectedFile(new File "D:/EVA/Recombination/RATData"+testSequence + ".csv"))*/
    try
    PrintWriter writ = new PrintWriter(new FileWriter(outFile));
    etc, etc.......
    Any suggestions?
    Cheers

    Thanks. It now works I had to change the PrintWriter to a BufferedWriter for it to work. I've posted working code below
    final JFileChooser fc = new JFileChooser();
    fc.addChoosableFileFilter(new FileFilterExt("Excel", new String[]{".csv"}));
    File outFile = new File(testSequence + ".csv");
    File dir = new File("D:/EVA/Recombination/RATData");
    fc.setCurrentDirectory(dir);
    fc.setSelectedFile(outFile);
    int returnVal = fc.showSaveDialog(null);
    if (returnVal == JFileChooser.APPROVE_OPTION)
    try
    String filename = fc.getSelectedFile().getAbsolutePath();
    BufferedWriter bw = new BufferedWriter(new FileWriter(filename));
    bw.write("whatever you want to write");// I'm writting from a Vector here, so this line is in a for loop.
    bw.flush();
    bw.close();
    catch (IOException e)
    System.out.print(e);
    Thanks for your help. My award will be made forwith.
    Cheers!

  • Facing problem in JFileChooser setSelectedFile

    Hi All,
    Am facing problem in JFileChooser's setSelectedFile.
    While trying to save the file I give a default file name which may contain "/" also.When I pass the File Object with the name(eg AC/B_XYZ_123) to the JFileChooser's setSelectedFile it is displaying the file name in the dialog as B_XYZ_1234 and it is not allowing me to browse through the directories.The file dialog is showing the default director if i try to move to some other directory for saving the file it is not moving insted it is again showing the same directory.
    the following lines of statements am using in my code.
    File defaultFile = new File("AS/B_FTies2107_0138.csv");
    fileChooser.setSelectedFile(defaultFile);
    if file doesnt contain any "/" then it works fine, i could able to browe through the directories and save the file,problem occurs only when the file name contains "/"
    in my dialog it is displaying the file name as "B_FTies2107_0138.csv"
    can any one help me in solving this problem.
    Thanks & Regards
    N.V.N.GopiKrishna

    It's because / is used to denote a new directory. This originated from *NIX type systems but also now works on Windows. Your best bet is to use a different character, maybe a hyphen.                                                                                                                                                                                                                                                                                                                                                                           

  • IndexOutOfBoundsException after upgrade

    Hi all,
    In some of our forms we use the Java class FFileChooser in the frmwebutil jar. After upgrading from version 10.1.2.0.2 to 10.1.2.3 we receive the following error on the Java Console:
    (The Dutch error message says: Unexpected Exception; Error: java.lang.IndexOutOfBoundsException: Invalid index)
    java.lang.IndexOutOfBoundsException: Invalid index
         at javax.swing.DefaultRowSorter.convertRowIndexToModel(Unknown Source)
         at sun.swing.FilePane$SortableListModel.getElementAt(Unknown Source)
         at javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
         at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
         at javax.swing.plaf.basic.BasicListUI.getCellBounds(Unknown Source)
         at javax.swing.JList.getCellBounds(Unknown Source)
         at javax.swing.JList.ensureIndexIsVisible(Unknown Source)
         at sun.swing.FilePane.ensureIndexIsVisible(Unknown Source)
         at sun.swing.FilePane.doDirectoryChanged(Unknown Source)
         at sun.swing.FilePane.propertyChange(Unknown Source)
         at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
         at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
         at java.awt.Component.firePropertyChange(Unknown Source)
         at javax.swing.JFileChooser.setCurrentDirectory(Unknown Source)
         at oracle.forms.webutil.file.FFileChooser.setCurrentDirectory(Unknown Source)
         at javax.swing.JFileChooser.setSelectedFile(Unknown Source)
         at oracle.forms.webutil.file.FFileChooser.setSelectedFile(Unknown Source)
         at oracle.forms.webutil.file.FFileChooser.setCurrentDirectory(Unknown Source)
         at oracle.forms.webutil.file.FileFunctions.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    2010-sep-24 09:01:56.440 ERROR>WUC-15 [FileFunctions.gfnDialog run()] Onverwachte fout; uitzondering: java.lang.IndexOutOfBoundsException: Invalid index
    After some investigation we discovered that the method setCurrentDirectory was changed between versions 10.1.2.0.2 and10.1.2.3. So we created a quick fix by creating a new FileChooser which extends the FFileChooser and overrides the setCurrentDirectory method.
    This works fine, but is there a more clean solution or maybe a patch?_
    Kind regards,
    Davy

    Hi all,
    What I forgot to say in my previous post is that we previously used our code with JInitiator in IE6, now we are using the Java Console with IE8.
    We did some more research tests on the problem:
    The problem is invariant to the OS of the client: both Windows and Unix clients get the same error for both IE8 and FireFox.
    Also the Java version is not the problem: tested with Java 1.6_21 and Java 1.5_11
    The problem is also invariant to the OS of the server.
    Anyone an idea?
    Maybe we should fire a bug report?
    Kind Regards,
    Davy

  • How to set selected file in FileChooser showSaveDialog to default file name

    Hi,
    How do I set selected file in JavaFX 2.0 FileChooser showSaveDialog, so I can prompt the user with a suggested default file name?
    I am converting a Java Swing application I wrote a few years ago to JavaFX 2.0.
    In the Swing application, I use setSelectedFile() as follows:
    JFileChooser jFileChooser = new JFileChooser();
    jFileChooser.setSelectedFile(new File(backupfile));
    jFileChooser.setCurrentDirectory(new File(outputDirectory));
    FileFilter filter = new FileNameExtensionFilter("Comma Delimited (*.csv)", "csv");
    jFileChooser.addChoosableFileFilter(filter);
    jFileChooser.setFileFilter(filter);
    filter = new FileNameExtensionFilter("XML Document (*.xml)", "xml");
    jFileChooser.addChoosableFileFilter(filter);
    jFileChooser.setAcceptAllFileFilterUsed(false);
    jFileChooser.setDialogTitle("Export File");
    int returnVal = jFileChooser.showDialog(jFrame, "Export");
    This would show a file chooser with the file name text field pre-populated with a default backup file name.
    I can't find an equivalent in JavaFX.
    Also, in the Swing application, I was able to determine which extension filter was selected at run time using getFileFilter().getDescription() as follows:
    String extension = jFileChooser.getFileFilter().getDescription();
    if (extension.equals("XML Document (*.xml)")) { ...
    I can't find an equivalent in JavaFX.
    Thanks,
    Barry

    You can use the open sequence file method on the application manager (then you only need to wire the file path)
    Rodéric L
    Certified LabVIEW Architect

  • How to determine which FileChooser ExtensionFilter has been selected

    Hi,
    I'm using a JavaFX fileChooser.showSaveDialog with two extension filters (*.csv and *.xml). How can I determine which filter was selected when the end-user clicks the save button?
    I am writing a program that allows the end-user to create an output file in CSV or XML format.
    If the end-user enters a file name with no extension, I need a way to determine if I should create a CSV or XML file. I would also like to add the proper extension to the file name if none is specified by the end-user. I want to do this based on which filter the end-user has selected. I wrote a Java program 5 years ago and I was able to do this with the following instruction:
    String extension = jFileChooser.getFileFilter().getDescription();
    I can't find a similar instruction for JavFX.
    My JavaFX Code:
    FileChooser fileChooser = new FileChooser();
    fileChooser.setInitialDirectory(new File(options.getOutputDirectory()));
    ExtensionFilter filter1 = new FileChooser.ExtensionFilter("Comma Delimited (*.csv)", "*.csv");
    fileChooser.getExtensionFilters().add(filter1);
    ExtensionFilter filter2 = new FileChooser.ExtensionFilter("XML Document (*.xml)", "*.xml");
    fileChooser.getExtensionFilters().add(filter2);
    File file = fileChooser.showSaveDialog(stage);
    String filename = file.getAbsolutePath();...How do I determine which extension filter has been selected?
    My Java Code:
    JFileChooser jFileChooser = new JFileChooser();
    jFileChooser.setCurrentDirectory(new File(outputDirectory));
    jFileChooser.setSelectedFile(new File(backupfile));
    FileFilter filter = new FileNameExtensionFilter("Comma Delimited (*.csv)", "csv");
    jFileChooser.addChoosableFileFilter(filter);
    jFileChooser.setFileFilter(filter);
    filter = new FileNameExtensionFilter("XML Document (*.xml)", "xml");
    jFileChooser.addChoosableFileFilter(filter);
    jFileChooser.setAcceptAllFileFilterUsed(false);
    jFileChooser.setDialogTitle("Export Alarms");
    jFileChooser.setBackground(colorFileChooser);
    int returnVal = jFileChooser.showDialog(jFrame, "Export");
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        File file = jFileChooser.getSelectedFile();
        String filename = file.getAbsolutePath();
        String extension = jFileChooser.getFileFilter().getDescription();
        if (extension.equals("XML Document (*.xml)")) {
            if (!filename.endsWith(".xml") && !filename.endsWith(".XML")) {
                filename = filename + ".xml";
            saveTableXML(filename);
        else if (extension.equals("Comma Delimited (*.csv)")) {
            if (!filename.endsWith(".csv") && !filename.endsWith(".CSV")) {
                filename = filename + ".csv";
            saveTableCSV(filename);
    }Thanks,
    Barry
    Edited by: 907965 on May 13, 2012 1:14 PM
    Edited by: 907965 on May 13, 2012 1:15 PM
    Edited by: 907965 on May 13, 2012 1:19 PM

    This problem is currently tracked as http://javafx-jira.kenai.com/browse/RT-18836.

  • File Choose question

    Hello everyone
    I am working on a swing application. I have a JFileChooser dialog and I wish to display all files that conform to a certain file filter, i.e.:
    tst*.jpg.
    I have used the file filter provided by Java in order to show only jpg files but I also need to be able to use the tst.
    Has anyone done something like this before?
    I have noticed that the user can type in the file name something like tst*.jpg and the dialog will only show files starting with tst that have an extension of jpg. I tryed to use a file filter and add the entire file but it ignores, as expected the ".", and creates a filter of the form ".tst*.jpg".
    I have used the method JFileChooser.SetName() and have set the string "tst*.jpg" but with no results.
    I have used the method JFileChooser.setSelectedFile() with parameter
    a file derived from the string "tst*.jpg". Still no results.
    Thanks for your time and responses.

    JFileChooser has a built-in FileFilter to handle regular expressions
    that the user types in. It is quite complex, but you can take a look
    at it in the source for javax/swing/plaf/basic/BasicFileChooserUI.java.
    Look for the class called GlobFilter. It is private, so unfortunately
    you can't use it directly.
    If you know exactly what you are looking for, why not just hardcode
    your FileFilter like this:
    public boolean accept(File f) {
        if (f != null) {
            if (f.isDirectory()) {
                return true;
            String name = f.getName();
            if (name.startsWith("tst") && name.endsWith(".jpg")) {
                return true;
        return false;
    }/Leif

  • Is it a bug in JFileChooser?

    JDK & JRE:
    java version "1.4.2_02"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_02-b03)
    Java HotSpot(TM) Client VM (build 1.4.2_02-b03, mixed mode)
    Operating System: Windows 2000 Advanced Server with sp4
    Description:
    Assume setting the JFileChooser's property as 'JFileChooser.FILES_AND_DIRECTORIES',
    double-clicking on a directory, enter the directory but no one file is selected,
    the text in the text-field that used for selected files is the name of this directory.
    For example, you've selected the directoy 'D:\jdk14', enter the directory and
    none is selected. Codes as below:
    File f = JFileChooser.getSelectedFile();
    String s = f.getAbsolutePath();
    The content of the variable named 's' is 'd:\jdk14\jdk14'

    Yes, it's a bug:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5075580

  • JFileChooser has a bug in 1.6?

    Hi,
    With JRE 1.5/1.4, I believed when you bring up the JFileChooser dialog and select the "Detail" view, you will get 4 columns: Name, Size, Type, and Modified.
    With 1.5/1.4, there seems to be 2 problems:
    1. You cannot sort the list by clicking on the column header
    2. The timestamp doesn't reflect the timezone.
    With 1.6, you get only 3 columns: Name, Size, Modified. However, the values in the Modified column should by "Type" instead. Is this a bug with the JFileChooser in 1.6? Have others seen the same thing?
    --Chung                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    In java 1.6.0_06 it works fine...

  • JFileChooser bug?

    Hi,
    I've encountered a strange thing (is it a bug?) in JFileChooser. It goes like this:
    in the Open File chooser, when I click on the name of a file, it goes to edit mode of that filename. If I click outside so as to cancel the renaming, a file in the directory gets deleted but its filename appears in the Open textfield!!!
    I am wondering whether it has something to do with my code, or something to do with the JFileChooser itself.
    My code looks like this:
    public void actionPerformed(ActionEvent e) {
    try{
    if (fc == null)
    fc = new JFileChooser();
    else
    fc.setVisible(true);
    fc.setCurrentDirectory(new File("robotSim/programs"));
    int returnedVal = fc.showOpenDialog(dialog);
    if (returnedVal == JFileChooser.APPROVE_OPTION){
    File file = fc.getSelectedFile();
    dialog.setFile(file);
    MyIO fileIO = new MyIO(file);
    String[] lines = fileIO.toArray();
    if (lines.length != 0){
    for (int i = 0; i < lines.length; i++)
    System.out.println(lines);
    programPanel = Converter.TextToBasicProgramPanel(lines);
    else {
    programPanel = new BasicProgramPanel();
    JOptionPane optionPane = new JOptionPane();
    optionPane.showMessageDialog(dialog, "Empty program!", "Warning",
    JOptionPane.WARNING_MESSAGE);
    dialog.setProgramPanel(programPanel);
    // done!
    System.out.println("OpenFileButtonListener: program panel from " +
    file.getName() + " loaded");
    catch(Exception ex){
    System.out.println("OpenFileButtonListener: " + ex);
    Is there a listener that takes care of the events performed in the file explorer window? If so, can I disable it?
    any comment is welcomed! Thx in advance.

    This is absolutely a bug. And it is a serious one at that.
    I found out about it while working on a project under Solaris 8.
    I just filed a bug report to Sun!

  • JFileChooser crashes JVM - bug basically ignored. What can I do?

    See:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7160713
    The bug has been marked as incomplete,needs more info, and "Low Prioroty" - Yet there is no mechanism to provide any more information. There is no way to add comments, or vote. The bug brings down the entire JVM with a native crash and it is trivial to reproduce.
    I would provide any information that is asked of me - but I need a way to do it. I think I got an email request for info (It's been a while now), but replies to the email bounced, and as noted above the bug page has no way to give feedback.
    Use any JFileChooser, click on the "Details" view. Then start clicking on column headings... after a few clicks the JVM crashes. Tested again with 7u6 - still crashes.

    This reproduces the problem more reliably for me.
    * JFileChooser Windows Crash
    package filechoosercrash;
    import java.awt.AWTEvent;
    import java.awt.BorderLayout;
    import java.awt.Robot;
    import java.awt.Toolkit;
    import java.awt.Window;
    import java.awt.event.AWTEventListener;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.InputEvent;
    import java.util.concurrent.CountDownLatch;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.LookAndFeel;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import javax.swing.UIManager.LookAndFeelInfo;
    import javax.swing.UnsupportedLookAndFeelException;
    * @author scott
    public class FileChooserCrash {
         static CountDownLatch latch = new CountDownLatch(1);
         static JFrame frame;
         static JButton button;
         static JFileChooser chooser;
         static Robot robot;
         private static AWTEventListener terminator = new AWTEventListener() {
              @Override
              public void eventDispatched(AWTEvent event) {
                   System.exit(10);
          * @param args the command line arguments
         public static void main(final String[] args) throws Exception {
              SwingUtilities.invokeLater(new Runnable() {
                   @Override
                   public void run() {
                        try {
                             swingMain(args);
                        } catch (Exception ex) {
                             Logger.getLogger(FileChooserCrash.class.getName()).log(Level.SEVERE, null, ex);
              latch.await();
              // do the clicks
              sleep(3000);
              Toolkit.getDefaultToolkit().addAWTEventListener(terminator, AWTEvent.KEY_EVENT_MASK);
              long now = System.currentTimeMillis();
              for (int c = 0; c < 10; c++) {
                   Window w = JDialog.getWindows()[1]; // better be there!
                   System.out.println("w=" + w);
                   int detailsX = w.getX() + w.getWidth() - 36;
                   int detailY = w.getY() + 50;
                   int headingY = w.getY() + 100;
                   System.out.println("details at " + detailsX + ", " + detailY);
                   // Click details
                   robot.mouseMove(detailsX, detailY);
                   clickMouse();
                   sleep(100);
                   // Click column headings
                   while (System.currentTimeMillis() - now < 2 * 1000) {
                        int headingX = w.getX() + (w.getWidth()/2) + (int) (Math.random() * (w.getWidth()/2));
                        robot.mouseMove(headingX, headingY);
                        clickMouse();
                        sleep(300);
                   // Cancel
                   robot.mouseMove(w.getX() + w.getWidth() - 36, w.getY() + w.getHeight() - 36);
                   clickMouse();
                   sleep(300);
                   // re-open
                   robot.mouseMove(frame.getX() + 36, frame.getY() + 36);
                   clickMouse();
                   sleep(1000);
                   now = System.currentTimeMillis();
         private static void sleep(int millis) {
              try {
                   Thread.sleep(millis);
              } catch (InterruptedException ex) {
         private static void clickMouse() {
              robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
              sleep(100);
              robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
         private static void swingMain(String[] args) throws Exception {
              //switchToNimbus();
              robot = new Robot();
              frame = new JFrame("JFileChooser Crash Test");
              button = new JButton("Start...");
              button.addActionListener(new ActionListener() {
                   @Override
                   public void actionPerformed(ActionEvent e) {
                        showFileChooser(frame);
              frame.getContentPane().add(button, BorderLayout.CENTER);
              frame.getContentPane().add(new JLabel("Press \"Start...\" and let go of the mouse.  Robot will be used to change FileChooser to details view and then quickly click column headings until the crash."), BorderLayout.SOUTH);
              frame.pack();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
         static void showFileChooser(JFrame parent) {
              chooser = new JFileChooser("C:\\");
              latch.countDown();
              chooser.showOpenDialog(parent);
         private static void switchToNimbus() throws UnsupportedLookAndFeelException, IllegalAccessException, InstantiationException, ClassNotFoundException {
              for (LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
                   if (laf.getName().startsWith("Nimbus")) {
                        System.out.println("Using " + laf.getName());
                        UIManager.setLookAndFeel(laf.getClassName());
                        break;
    }

  • JFileChooser problem - A bug ???

    Hi all,
    i am facing a unique problem with the JFileChooser. when i go to the "Look in" drop down list and select "Network Neighborhood", what i expect is to get a list of all computers on my LAN. i do get it, but the filechooser does seem to recognise the system names. the names that r displayed seem to be kind of substrings of "Network".
    E.g: etwork, ft Network, soft Network etc..., instead of proper system names.
    but when i double click on a folder, then it displays the shared folder names correctly, and also identifies the system name. it says something like:
    "folderName" on "systemName"
    if the filechooser is able to recognise the system name here, then why does it not display the system names properly in the aforesaid place (ie, when i select Network Neighborhood) initially.
    am running jdk ver 1.4, on a windows 98 system. is it somekind of a bug or am i missing something that i need to do ? could not find any help from the API.
    any idea anyone ???
    thanks
    - satyen

    1.4.2 has a fix for JFileChooser, although I am not
    sure its this problem, or hopefully the one I see
    often, when I click the drop down box to navigate to a
    network drive, it sometimes takes a VERY long time, on
    the order of hours, for the drop down to show up. On
    of our clients is seeing this now, so I am not sure
    why this is.The problem here is that Windows98 Network communication is appalling slow a lot of the time and some bits of it is broken.
    Getting the members list from a network can take an age simply because you sometimes have to broadcast a query on that network to find all the machines on it. This is not a Java related problem (although I suspect that VM support for Windows98 has slipped in priority ).

  • JFileChooser home button shows desktop - bug?

    Running jdk 1.4.1 on XP I would expect the home button to direct the user to his or her "My Documents" folder. However, when clicking the home button, the desktop is shown. Is this a known bug? Is there a workaround?
    Randahl

    i think you can decide which directory is the home directory.
    JFileChooser
    public JFileChooser()Constructs a JFileChooser pointing to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.
    This is taken from the JFileChooser interface... its not a bug its the default value. You can alterate that using a different constructor such as
    public JFileChooser(String currentDirectoryPath)Constructs a
    JFileChooser using the given path. Passing in a null string causes the file chooser to point to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.
    Hope this helps

  • Bug JFileChooser freeze!

    I can't use JFileChooser. When I write in my aplication: new JFileChooser(); the aplication freeze (examples with JFileChooser from sun have the same problem).
    I have windows Xp and jdk 1.6.0_03(same in jdk 1.6.0_04), my friends that use the WindowsXp and Jdk 1.6 don't have this problem.
    Could someone advice what to do to get rid of this bug?
    Thank you.

    I solved the problem.
    I had a bad sortcut(con.lnk) in desktop, I couldn't delete this file(windows or dos). Finally I used Unlocker 1.8 that help me to delete this bad link (con.lnk) and now evrything works fine :)
    The problem wasn't in my aplication, I write a simple HelloWord.java and include new JFileChooser() and aplication freeze. As I said I had the same problem running examples with JFileChooser from http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html .

Maybe you are looking for