mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
System File Chooser: on Linux when JavaFX is used in application, then always use Swing file chooser because system file dialog does work (PR #988)
with Java 8, some GLib related messages are logged to console and system file dialog is not shown e.g.: `GLib-GObject-WARNING **: cannot register existing type 'GdkDisplayManager'` with Java 17, the system file dialog is shown, but then JavaFX no longer works with Java 21, the application quits/crashes immediately when trying to show system file dialog also fixed Error Prone warning in `getFiltersForDialog()`
This commit is contained in:
@@ -77,7 +77,7 @@ public class FlatSystemFileChooserTest
|
||||
FlatSystemFileChooserTest() {
|
||||
initComponents();
|
||||
|
||||
if( !NativeJFileChooser.FX_AVAILABLE ) {
|
||||
if( SystemInfo.isLinux || !NativeJFileChooser.FX_AVAILABLE ) {
|
||||
javafxOpenButton.setEnabled( false );
|
||||
javafxSaveButton.setEnabled( false );
|
||||
}
|
||||
@@ -231,7 +231,7 @@ public class FlatSystemFileChooserTest
|
||||
int fileTypeIndex = fileTypeIndexSlider.getValue();
|
||||
if( !useAcceptAllFileFilterCheckBox.isSelected() )
|
||||
fc.setAcceptAllFileFilterUsed( false );
|
||||
for( int i = 0; i < fileTypes.length; i += 2 ) {
|
||||
for( int i = 0; i < fileTypes.length; i += 2 ) {
|
||||
fc.addChoosableFileFilter( "*".equals( fileTypes[i+1] )
|
||||
? fc.getAcceptAllFileFilter()
|
||||
: new SystemFileChooser.FileNameExtensionFilter( fileTypes[i], fileTypes[i+1].split( ";" ) ) );
|
||||
@@ -282,7 +282,7 @@ public class FlatSystemFileChooserTest
|
||||
int fileTypeIndex = fileTypeIndexSlider.getValue();
|
||||
if( !useAcceptAllFileFilterCheckBox.isSelected() )
|
||||
fc.setAcceptAllFileFilterUsed( false );
|
||||
for( int i = 0; i < fileTypes.length; i += 2 ) {
|
||||
for( int i = 0; i < fileTypes.length; i += 2 ) {
|
||||
fc.addChoosableFileFilter( "*".equals( fileTypes[i+1] )
|
||||
? fc.getAcceptAllFileFilter()
|
||||
: new FileNameExtensionFilter( fileTypes[i], fileTypes[i+1].split( ";" ) ) );
|
||||
|
||||
Reference in New Issue
Block a user