diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java index c1188345..e935fa06 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java @@ -59,22 +59,23 @@ * {@snippet lang = java: * import overrungl.util.value.Pair; * void main() { - * NFD.init(); + * var nfd = NFD.INSTANCE; + * nfd.init(); * * try (MemoryStack stack = MemoryStack.stackPush()) { * String[] outPath = new String[1]; * var filterItem = NFDNFilterItem.create(stack, * new Pair<>("Source code", "java"), * new Pair<>("Image file", "png,jpg")); - * var result = NFD.openDialogN(outPath, filterItem, null); + * var result = nfd.openDialogN(outPath, filterItem, null); * switch (result) { - * case ERROR -> System.err.println(STR."Error: \{NFD.getError()}"); + * case ERROR -> System.err.println(STR."Error: \{nfd.getError()}"); * case OKAY -> System.out.println(STR."Success! \{outPath[0]}"); * case CANCEL -> System.out.println("User pressed cancel."); * } * } * - * NFD.quit(); + * nfd.quit(); * }} * *

File Filter Syntax

diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDResult.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDResult.java index 125c6b91..8d3054b3 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDResult.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDResult.java @@ -57,7 +57,7 @@ public static NFDResult of(int i) { case 0 -> ERROR; case 1 -> OKAY; case 2 -> CANCEL; - default -> throw new IllegalArgumentException(i); + default -> throw new IllegalArgumentException(STR."Unexpected value: \{i}"); }; }