// add a control to the dialog to add the extension automatically to the filename...
XFilePickerControlAccess xFilePickerControlAccess =(XFilePickerControlAccess)UnoRuntime.queryInterface(XFilePickerControlAccess.class, xFilePicker);
xFilePickerControlAccess.setValue(com.sun.star.ui.dialogs.ExtendedFilePickerElementIds.CHECKBOX_AUTOEXTENSION, (short) 0, new Boolean(true));
XFilterManager xFilterManager = (XFilterManager)UnoRuntime.queryInterface(XFilterManager.class, xFilePicker);
xFilterManager.appendFilter("PNG - Portable Network Graphic", ".png");
xFilterManager.appendFilter("JPEG - Joint Photographic Experts Group", ".jpg");
xFilterManager.appendFilter("GIF - Graphics Interchange Format", ".gif");
xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xFilePicker);
XExecutableDialog xExecutable = (XExecutableDialog)UnoRuntime.queryInterface(XExecutableDialog.class, xFilePicker);
short nResult = xExecutable.execute();
if (nResult == com.sun.star.ui.dialogs.ExecutableDialogResults.OK){