From 9b6b841d761401028f4e0f70094dc3abc83cbae8 Mon Sep 17 00:00:00 2001 From: aah13002 Date: Wed, 30 Mar 2016 17:46:09 -0400 Subject: [PATCH] Look and feel is now set to be cross platform --- src/test/GUITest.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/test/GUITest.java b/src/test/GUITest.java index 59f3532..9a58bbc 100644 --- a/src/test/GUITest.java +++ b/src/test/GUITest.java @@ -1,10 +1,32 @@ package test; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + import view.CheckersWindow; public class GUITest { public static void main(String[] args) { + + // Need to set the look and feel for this to be cross platform + try { + // Set cross-platform Java L&F (also called "Metal") + UIManager.setLookAndFeel( + UIManager.getCrossPlatformLookAndFeelClassName()); + } + catch (UnsupportedLookAndFeelException e) { + // handle exception + } + catch (ClassNotFoundException e) { + // handle exception + } + catch (InstantiationException e) { + // handle exception + } + catch (IllegalAccessException e) { + // handle exception + } CheckersWindow window = new CheckersWindow(); } }