Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'd like a way to embed the JFileChooser as a JComponent instead of showing it #132

Open
DanKaplanSES opened this issue Apr 14, 2013 · 2 comments

Comments

@DanKaplanSES
Copy link

I want to do exactly what's described in this Stack Overflow question: http://stackoverflow.com/questions/259575/jfilechooser-embedded-in-a-jpanel but it doesn't seem possible with seesaw because seesaw only gives you the ability to show a JFileChooser, it doesn't give you the option to just return the JComponent.

I'd like to be able to do this:

JFileChooser fc = ...
JPanel panel ...
panel.add(fc);
@daveray
Copy link
Collaborator

daveray commented Apr 15, 2013

hmmm... yeah. there should be just a file-chooser function in addition to choose-file. In the meantime you can just manually create and configure a JFileChooser:

(require 'seesaw.chooser)
(use 'seesaw.core)

(let [fc (config! (javax.swing.JFileChooser.) :multi? false)]
  (border-panel :center fc))

@DanKaplanSES
Copy link
Author

Yep, that's pretty much what I did. In fact it was so easy I'm not sure if this is a real issue. My concern would be with people who don't know how to write swing code, they may get lost in this.

It would be really nice to be able to define a :success-fn, etc. I didn't try doing that with config! but I'll see if that works tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants