Unfortunately, there is no trivial way to do this, because whenever you show a chooser, the internal createDialog method sets the location to the center of the parent.
One way to do this is to subclass JFileChooser and override the createDialog method as follows:
static class MyChooser extends JFileChooser {
protected JDialog createDialog(Component parent)
throws HeadlessException {
JDialog dlg = super.createDialog(parent);
dlg.setLocation(20, 20);
return dlg;
}
}
Now you can directly uise MyChooser instead of JFileChooser. In the code above, I hardcoded the location to 20, 20, but you can configure it to whatever you want.