Questions tagged [jfilechooser]

JFileChooser is a Java Swing component to provide a simple mechanism for the user to choose a file.

JFileChooser is a Java Swing component to provide a simple mechanism for the user to choose a file. For information about using JFileChooser, see How to Use File Choosers, a section in The Java Tutorial.

1167 questions
10
votes
5 answers

InterruptedException after cancel file open dialog - 1.6.0_26

The output from the code that follows is: java.vendor Sun Microsystems Inc. java.version 1.6.0_26 java.runtime.version 1.6.0_26-b03 sun.arch.data.model 32 os.name Windows XP os.version 5.1 os.arch x86 Input selection cancelled…
mhollander38
  • 775
  • 3
  • 11
  • 22
10
votes
1 answer

access mtp device with java

I have developed a small application that copies files from a folder to another.I use a JFileChooser to select the target directory.Something I hadn't tried for a long time is to select my phone as the target directory.I tried but I couldn't find it…
cssGEEK
  • 994
  • 2
  • 15
  • 38
10
votes
2 answers

Alternative to JFileChooser on Linux?

I don't like this ugly FileChooser layout in Linux. This layout is used by any other program and is MUCH more beautiful. Is this layout available in Java? If so, how?
Martijn Courteaux
  • 67,591
  • 47
  • 198
  • 287
10
votes
8 answers

Windows look and feel for JFileChooser

I'm trying to generate a JFileChooser that has the Windows look-and-feel. I couldn't find a method to change it, so I created a base class that extends JFileChooser that changes the UI with the following code: public FileChooser(){ …
chama
  • 5,973
  • 14
  • 61
  • 77
10
votes
4 answers

JFileChooser for directories on the Mac: how to make it not suck?

The JFileChooser in "directories only" mode on the Mac has two serious, crippling problems: 1) You cannot create directories with it 2) You cannot switch drives This is rather a huge problem for my installer app. As far as I can tell, Apple provides…
Mike Hearn
  • 259
  • 2
  • 6
10
votes
3 answers

Browse for image file and display it using Java Swing

My problem here is, after clicking Browse button it displays all files in a directory to choose, then the chosen image is displayed in GUI correctly. But When i click Browse button for the second time, it shows the old image only instead of showing…
user1844951
  • 103
  • 1
  • 1
  • 5
10
votes
3 answers

Clear JFileChooser selection after adding files to a JList

For a simple Swing application for merging PDFs with Apache PDFBox I'm using a JFileChooser to select one or multiple PDF files and add it/them to a JList. No problems so far. What bothers me is that the previous selection persists in the…
devrys
  • 1,571
  • 3
  • 27
  • 43
9
votes
2 answers

How to select default FileFilter when creating a JFileChooser dialog?

Good afternoon all, I have an instance of a javax.swing.JFileChooser and I added a few choosable javax.swing.FileFilters using addChoosableFileFilter. However when I show the dialog (through showSaveDialog), my custom choosable FileFilter is not…
Pacerier
  • 86,231
  • 106
  • 366
  • 634
9
votes
3 answers

Get the path of a directory using JFileChooser

How can I get the absolute path of a directory using JFileChooser, just selecting the directory?
Harsha
  • 3,548
  • 20
  • 52
  • 75
9
votes
3 answers

JFileChooser from a command line program and popping up Underneath all windows

Ive implemented the jFileChooser in my command line program and it works, just as it should with only one annoying issue. It seems that it opens underneath every window with no alert of any kind. In fact I even missed it a couple of times at first…
kyle phill
  • 211
  • 2
  • 7
9
votes
2 answers

System look and feel layout on JFileChooser but with nimbus look and feel theme

The windows look and feel layout on JFileChooser is much better than other look and feels like nimbus. So I'm looking for a way to have the layout of a system look and feel but have nimbus or others theme on top. Is this possible? If so how can it…
Daniel Ryan
  • 6,976
  • 5
  • 45
  • 62
9
votes
1 answer

How to display network shares using JFileChooser in Java 9+?

The users of our software need to browse network shares on Windows 10 in our Java swing application, however swing's JFileChooser does not have this capability by default. In this related post How to navigate to a network host in JFileChooser? A…
ToddWebb
  • 101
  • 6
9
votes
2 answers

How to get directory path using JFileChooser?

I have a small java GUI application with a text field on it. When the user clicks the text field an event is triggered and the JFileChooser is launched. It's restricted to directories only. What I'm trying to do is to get the full path of the…
Henry E. Wilson
  • 93
  • 1
  • 1
  • 3
9
votes
4 answers

JFileChooser - multiple file filters?

I have a question about the JFileChooser in Swing. I'm trying to get multiple file extensions in the drop-down box, but have no idea how to do it. There is the method extFilter = FileNameExtensionFilter(description, extensions); that I can then use…
bcoughlan
  • 25,987
  • 18
  • 90
  • 141
9
votes
2 answers

Adding multiple files with JFileChooser

I'm looking to make an application that allows you to attach files from your computer. For example, when the JFileChooser opens you have the option to select multiple files and when you click "add" it adds it to the window and you can then have…
rogerthat
  • 1,805
  • 4
  • 20
  • 34
1 2
3
77 78