Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Problem with JFileChooser

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!

 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Evacuate the building! Here, take this tiny ad with you:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic