Reputation: 315
I have used the JFileChooser
option but by default, it shows save and cancel button. I want to put an OK button instead of save button. How do I do that?
Upvotes: 1
Views: 719
Reputation: 4534
Maybe this one help:
JFileChooser j = new JFileChooser();
j.showDialog(this, "ok");
Upvotes: 3
Reputation: 11911
When using one of the showDialog()
-variants you can use
showDialog(Component parent, String approveButtonText)
with an approveButtonText
of your choice.
If you instanciate your own JFileChooser
use
setApproveButtonText(String approveButtonText)
to change the button's text.
Upvotes: 2