From 855c29b728420c652a05ab6c94e642d928d84a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Ulman?= Date: Fri, 22 Nov 2024 08:23:55 +0100 Subject: [PATCH] fix: c'tor of ImprovedFormattedTextField form field wasn't... (#94) ...considering the initial value, and was thus always displaying an empty field (no text) --- .../janelia/saalfeldlab/n5/ui/ImprovedFormattedTextField.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/janelia/saalfeldlab/n5/ui/ImprovedFormattedTextField.java b/src/main/java/org/janelia/saalfeldlab/n5/ui/ImprovedFormattedTextField.java index ef4ec10b..ae89d386 100644 --- a/src/main/java/org/janelia/saalfeldlab/n5/ui/ImprovedFormattedTextField.java +++ b/src/main/java/org/janelia/saalfeldlab/n5/ui/ImprovedFormattedTextField.java @@ -67,8 +67,9 @@ public ImprovedFormattedTextField(AbstractFormatter formatter) { public ImprovedFormattedTextField(AbstractFormatter formatter, Object aValue) { this(formatter); + String strValue = aValue instanceof String ? (String)aValue : ""; try { - setValue(new URI("")); + setValue(new URI(strValue)); } catch (URISyntaxException e) { e.printStackTrace(); }