Java tutorial
//package com.java2s; import java.io.File; import javax.swing.JFileChooser; import javax.swing.filechooser.FileNameExtensionFilter; public class Main { private static JFileChooser getXMLfileChooser() { JFileChooser fc = new JFileChooser(new File("../comportamientos")); // set ExtensionFile... fc.setMultiSelectionEnabled(false); fc.setAcceptAllFileFilterUsed(false); FileNameExtensionFilter filter = new FileNameExtensionFilter("XML", "xml"); fc.setFileFilter(filter); return fc; } }