Closed alexanderkoller closed 6 years ago
cross-platform file opening/closing dialogs in Java are a pain. The three following requirements cannot be met simultaneously, so we'll have to decide what we want:
So, it's really up to what we want to sacrifice:
I'd sacrificy modality. Other voters?
with some changes, I get the JavaFX-version to be sort-of modal, see also https://github.com/veluria/NativeJFileChooser/issues/2 .
I pushed a branch filedialog -- @alexanderkoller: could you try if it works on MacOS? Just check that loading/saving still works.
Hi @alexanderkoller , is it safe to assume that file loading/saving works on the filedialog branch for you (representative of all osX users) and I can merge?
this works nicely on linux. please re-open if it fails on your platform.
our file-suffix is now .dos
Java on Ubuntu 18.04 does not seem to work like it did in 17.10. I get the following instead of a file-dialog:
java.lang.NoClassDefFoundError: javafx/stage/DirectoryChooser
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3119)
at java.base/java.lang.Class.getDeclaredMethod(Class.java:2432)
at java.desktop/java.awt.Component.isCoalesceEventsOverriden(Component.java:6274)
at java.desktop/java.awt.Component.access$400(Component.java:185)
at java.desktop/java.awt.Component$3.run(Component.java:6228)
at java.desktop/java.awt.Component$3.run(Component.java:6226)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.Component.checkCoalescing(Component.java:6225)
at java.desktop/java.awt.Component.<init>(Component.java:6194)
at java.desktop/java.awt.Container.<init>(Container.java:294)
at java.desktop/javax.swing.JComponent.<init>(JComponent.java:598)
at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:347)
at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:325)
at li.flor.nativejfilechooser.NativeJFileChooser.<init>(NativeJFileChooser.java:96)
at com.clt.gui.FileChooser.standardGetFile(FileChooser.java:124)
at com.clt.gui.FileChooser.standardGetFile(FileChooser.java:79)
at com.clt.diamant.Main.openDocument(Main.java:306)
at com.clt.diamant.Main.doCommand(Main.java:586)
at com.clt.diamant.Main$4.run(Main.java:170)
at com.clt.util.AbstractAction.actionPerformed(AbstractAction.java:141)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6589)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6354)
at java.desktop/java.awt.Container.processEvent(Container.java:2261)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4966)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2319)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4914)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4543)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4484)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2305)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: javafx.stage.DirectoryChooser
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
... 57 more
I'll open this as a new bug