Community
Participate
Working Groups
Created attachment 285428 [details] GIF that demonstrates the bug FileDialog doesn't change Temp.png to Temp.bmp in the file name field when I change PNG to BMP in the extension selector. Please see the attached GIF. The bug is reproduced on Catalina and Big Sur but not reproduced on old High Sierra (High Sierra changes the file name as expected). Manual editing in the file name field works OK. You can use this code to reproduce the bug: import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; public class Main { public static void main(String[] args) throws Exception { Display display = new Display(); Shell shell = new Shell(display); shell.setText("File Dialog Example"); shell.setLayout(new FillLayout()); shell.open(); FileDialog fileDialog = new FileDialog(shell, SWT.SAVE); fileDialog.setText("File dialog text"); fileDialog.setFilterNames(new String[] {"PNG (*.png)", "BMP (*.bmp)" }); fileDialog.setFilterIndex(0); fileDialog.setFileName("Temp"); fileDialog.setFilterPath("/Users/<user>/Documents"); fileDialog.setFilterExtensions(new String[] {"*.png", "*.bmp" }); String result = fileDialog.open(); System.out.println(result); // Always prints Temp.png on Catalina/BigSur while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } }
*** This bug has been marked as a duplicate of bug 567754 ***