Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1637 > unrolled thread

Re: Is this a bug in java

Started by"Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this>
First post2011-04-27 15:34 +0000
Last post2011-04-27 15:34 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.lang.java.gui

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Is this a bug in java "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
    Re: Is this a bug in java "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
      Re: Is this a bug in java "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000

#1637 — Re: Is this a bug in java

From"Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this>
Date2011-04-27 15:34 +0000
SubjectRe: Is this a bug in java
Message-ID<1179357824.579760.78120@k79g2000hse.googlegroups.com>
  To: comp.lang.java.gui,comp.l
On May 16, 10:54 am, RC <raymond.c...@nospam.noaa.gov> wrote:
> When I open a JFileChooser.
> If I SINGLE click a directory and click the Open button.
> Then I got return $paths/selected_directory.
>
> That is good!
>
> However if I DOUBLE click a directory and click the Open button.
> Then I got return $paths/selected_directory/selected_directory
>
> Why I got selected_directory twice from return?
> Is this a bug or I missed somethings?
>
> Do you have a solution for that?
> Thank Q very much in advance!

If you notice, when you first click the directory, the name appears in
the text field.
When you double click, you enter that directory, but the name stays in
the text field.

The name staying in the text field is definitely what causes your
described behavior.
<sscce>
import javax.swing.*;
public class FileChoo {
    public static void main(String[] args) {
        final JFileChooser jFileChooser = new JFileChooser();
 
jFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        jFileChooser.showOpenDialog(null);
        System.out.println("file = " +
jFileChooser.getSelectedFile());
    }
}
</sscce>

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#1638

From"Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Date2011-04-27 15:34 +0000
Message-ID<724a9d0e0d4c7@uwe>
In reply to#1637
  To: comp.lang.java.gui
Daniel Pitts wrote:
..
>If you notice, when you first click the directory, the name appears in
>the text field.
>When you double click, you enter that directory, but the name stays in
>the text field.

(snip code)

Using that code, and Java 1.6 on XP, I could not reproduce
the behaviour described.  In all combinations of single or 
double clicks, the chooser correctly identified the directory 
I was opening.

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-gui/200705/1

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#1648

From"Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this>
Date2011-04-27 15:34 +0000
Message-ID<1179426653.855610.12740@q23g2000hsg.googlegroups.com>
In reply to#1638
  To: comp.lang.java.gui
On May 16, 8:01 pm, "Andrew Thompson" <u32984@uwe> wrote:
> Daniel Pitts wrote:
>
> ..
>
> >If you notice, when you first click the directory, the name appears in
> >the text field.
> >When you double click, you enter that directory, but the name stays in
> >the text field.
>
> (snip code)
>
> Using that code, and Java 1.6 on XP, I could not reproduce
> the behaviour described.  In all combinations of single or
> double clicks, the chooser correctly identified the directory
> I was opening.
On RedHat Linux, Java 5, I was able to reproduce the OP's "problem".
So, apparently its been fixed in 1.6.

Daniel.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web