- How to show the Open File dialog box when a user clicks on a JTextField?
- this.textField.addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent event) {
- // Show the Open File dialog box.
- // Same as lines 86-93 in the link below.
- }
- public void focusLost(FocusEvent event) {
- // Do nothing.
- }
- }