• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFilechooser event double click problems  RSS feed

 
paul beppe
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!!!

don't show message when i click in jfilechoooser

this is code:



where is the problems???
 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you adding that Listener in the first place?
 
paul beppe
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to do???

i don't understand my problem

i have add Listener for show message and later add name of file selected in JTextArea....

help me please!!!
 
paul beppe
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want show message with double click on JFileChooser and i have add Listener in chooser...

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Campbell: opening a dialog from within a dialog does not seem to be a good UI.

(Personally, I prefer using java.awt.FileDialog over javax.swing.JFileChooser - it gets you a native component that is far more functional than Swing's component. Unless you're using specialized features like accessories, that is.)
 
paul beppe
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in this site web
http://stackoverflow.com/questions/10232281/java-jfilechooser-returns-the-selected-directory-instead-of-browsing-it

there is one example

bat i have problem...

help me please!!!

i want open file in jfilechooser with double click

 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The dialogue from a file chooser has a particular means of operation, and you should use that as a preference.
I never knew about FileDialog.
 
m Korbel
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there are two (non important issues :-), then works in all cases (from two jokes, so funny 1.7_045/_051 too)

- JOptionPane should has a parent (JComponent declared inside current class or JComponent declared and initialized as local variable)

- JOptionPane should be wrapped into invokeLater (delayed to the end of EDT)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!