From 4f78391cbb8cbe5d52685e27fecc6e9729d3f2d7 Mon Sep 17 00:00:00 2001 From: Vignesh Date: Tue, 20 Mar 2018 03:51:37 +0530 Subject: [PATCH] UI of the validate application now feels modern (#54) --- .../opendatakit/validate/FormValidator.java | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/org/opendatakit/validate/FormValidator.java b/src/org/opendatakit/validate/FormValidator.java index b3ac5bc..fed4dd5 100644 --- a/src/org/opendatakit/validate/FormValidator.java +++ b/src/org/opendatakit/validate/FormValidator.java @@ -44,6 +44,8 @@ import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; import javax.xml.parsers.DocumentBuilderFactory; import org.javarosa.core.model.Constants; @@ -120,12 +122,28 @@ public class FormValidator implements ActionListener { public static void main(String[] args) { - if ( args.length == 1 ) { - String path = args[0]; - new FormValidator().validateAndExitWithErrorCode(path); - } else { - new FormValidator().show(); + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + if (args.length == 1) { + String path = args[0]; + new FormValidator().validateAndExitWithErrorCode(path); + } else { + new FormValidator().show(); + } + } + catch (UnsupportedLookAndFeelException e) { + e.printStackTrace(); } + catch (ClassNotFoundException e) { + e.printStackTrace(); + } + catch (InstantiationException e) { + e.printStackTrace(); + } + catch (IllegalAccessException e) { + e.printStackTrace(); + } + }