• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with JFileChooser

 
James Basller
Ranch Hand
Posts: 58
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have made a simple Swing Program which consist of following fields.

JTextField,JButton,JFileChooser

Now, when user select file from JFileChooser the whole path will be set into the TextField.

This works perfectly on Windows OS but when I am trying to run application on Mac OS then it's not reflecting selected file means it's not selecting selected file by JFileChooser.

Is this OS level issue or should I need to change anything regarding Mac OS?

Thanks in advance!!!

 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This doesn't sound like something where there should be any differences between the various OSes.

At which point does it break down - Is the path returned from the JFileChooser correct? Is the code to set the text in the JTextField being called? Seeing a short code excerpt that performs these steps would be helpful.
 
James Basller
Ranch Hand
Posts: 58
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:This doesn't sound like something where there should be any differences between the various OSes.

At which point does it break down - Is the path returned from the JFileChooser correct? Is the code to set the text in the JTextField being called? Seeing a short code excerpt that performs these steps would be helpful.



Hi,

Thanks for considerations. Actually when user select file from JFileChooser Dialog it's not reflecting to the textfield. Means I think file selection is not affected. What I am doing is when user selects file from filechooser then I take absolute path of that file and will be displayed in the textfield. But on Mac it's not selecting file in that.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that's pretty much what you said in your first post already.
What are the answers to the questions? Without those, it's going to be hard to help.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic