Skip to content

Example file picker does not work #72

@Daniel99j2

Description

@Daniel99j2

When using the file picker:
@entry(category = FILE,
selectionMode = JFileChooser.FILES_ONLY,
fileExtensions = {"json", "txt", "log"}, // Define valid file extensions
fileChooserType = JFileChooser.SAVE_DIALOG,
name = "I am a file!")
public static String myFile = ""; // The isFile property adds a file picker button
When pressing on the folder button, it does not open and there is an error:
[09:03:08] [Thread-20/ERROR] (FabricLoader) Uncaught exception in thread "Thread-20"
java.awt.HeadlessException: null
at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:164) ~[?:?]
at java.desktop/java.awt.Window.(Window.java:553) ~[?:?]
at java.desktop/java.awt.Frame.(Frame.java:428) ~[?:?]
at java.desktop/java.awt.Frame.(Frame.java:393) ~[?:?]
at java.desktop/javax.swing.SwingUtilities$SharedOwnerFrame.(SwingUtilities.java:1925) ~[?:?]
at java.desktop/javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:2001) ~[?:?]
at java.desktop/javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1696) ~[?:?]
at java.desktop/javax.swing.JOptionPane.getWindowForComponent(JOptionPane.java:1637) ~[?:?]
at java.desktop/javax.swing.JFileChooser.createDialog(JFileChooser.java:815) ~[?:?]
at java.desktop/javax.swing.JFileChooser.showDialog(JFileChooser.java:762) ~[?:?]
at eu.midnightdust.lib.config.MidnightConfig$MidnightConfigScreen.lambda$fillList$11(MidnightConfig.java:366) ~[midnightlib-1.6.3-fabric.jar:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]

Fabric version:
0.16.7 and 0.106.0+1.21.1
Midnight version:
1.6.3-fabric
Mc version:
1.21.1 Fabric

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions