dcsimg

How do I initialize the text field (file name) in a JFileChooser?

John Zukowski

You have to work with the UI component for this:

JFileChooser fileChooser = new JFileChooser(".");
BasicFileChooserUI ui = (BasicFileChooserUI)fileChooser.getUI();
ui.setFileName("help.jpg");