Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Open:
- JFileChooser fileChooser = new JFileChooser();
- if (fileChooser.showOpenDialog(modalToComponent) == JFileChooser.APPROVE_OPTION) {
- File file = fileChooser.getSelectedFile();
- // load from file
- }
- Save:
- JFileChooser fileChooser = new JFileChooser();
- if (fileChooser.showSaveDialog(modalToComponent) == JFileChooser.APPROVE_OPTION) {
- File file = fileChooser.getSelectedFile();
- // save to file
- }
Advertisement
Add Comment
Please, Sign In to add comment