Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

FileChoosers very quick question  RSS feed

 
Dianne Gerrelli
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me the correct way to write a FileChooser. I am trying to write one to incorporate into my GUI (see thread below if you want a laugh as it looks beautiful but does nothing).

Is it best to put the code for a FileChooser in a separate class rather than putting all the code into an actionPerformed method where the events will be caught?

Best wishes
Dianne
 
Paul Clapham
Sheriff
Posts: 22502
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're a beginner then you don't write a FileChooser. You use one that has already been written, like JFileChooser for example.

Or were you asking about incorporating a JFileChooser into your GUI? If you look at the API documentation and follow the link "How to Use File Choosers" then you will see some examples.
 
Dianne Gerrelli
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul, I was intend asking about using a fileChooser within a GUI what I am not sure of is the logical place to call this method. All the code I have seen seems really complicated and the GUI I am attempting to write is split into multiple files which you can see in a thread below.

Best wishes
Dianne
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that Ulf included some FileChooser code in response to one of your other threads. See if that helps.
 
Paul Clapham
Sheriff
Posts: 22502
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by marc weber:
one of your other threads
Oh, THAT's what you meant by "a thread below".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!