Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1035149 // showDirChooser

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (41L/1K).

1  
svoid showDirChooser(Component parent default null, File defaultDir, IVF1<File> action) {
2  
  JFileChooser fileChooser = new JFileChooser(defaultDir);
3  
  fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
4  
  fileChooser.setAcceptAllFileFilterUsed(false);
5  
6  
  if (fileChooser.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION)
7  
    action?.get(fileChooser.getSelectedFile());
8  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035149
Snippet name: showDirChooser
Eternal ID of this version: #1035149/3
Text MD5: 2aa2fafb37ed095c01787e1df59316bb
Transpilation MD5: 776dd152f56abbbd0afbdb90ed347100
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-01 21:59:28
Source code size: 395 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 159 / 211
Version history: 2 change(s)
Referenced in: [show references]