Prevent NPE on Aqua LaF by explicitly using Metal
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 25 Mar 2016 07:34:02 +0100
changeset 4119eb6379b97f0
parent 410 c884e4396eeb
child 412 4034db7484a3
Prevent NPE on Aqua LaF by explicitly using Metal
samples/trycatchredo/test/org/apidesign/exceptions/trycatchredo/api/IOManagerTest.java
     1.1 --- a/samples/trycatchredo/test/org/apidesign/exceptions/trycatchredo/api/IOManagerTest.java	Thu Mar 17 09:17:54 2016 +0100
     1.2 +++ b/samples/trycatchredo/test/org/apidesign/exceptions/trycatchredo/api/IOManagerTest.java	Fri Mar 25 07:34:02 2016 +0100
     1.3 @@ -7,11 +7,15 @@
     1.4  import java.net.URL;
     1.5  import javax.swing.Action;
     1.6  import javax.swing.JOptionPane;
     1.7 +import javax.swing.UIManager;
     1.8 +import javax.swing.UnsupportedLookAndFeelException;
     1.9 +import javax.swing.plaf.metal.MetalLookAndFeel;
    1.10  import org.apidesign.exceptions.trycatchredo.usage.QueryStream;
    1.11  import org.junit.After;
    1.12  import org.junit.Before;
    1.13  import org.junit.Test;
    1.14  import static org.junit.Assert.*;
    1.15 +import org.junit.BeforeClass;
    1.16  
    1.17  /**
    1.18   *
    1.19 @@ -22,6 +26,11 @@
    1.20      public IOManagerTest() {
    1.21      }
    1.22  
    1.23 +    @BeforeClass
    1.24 +    public static void useMetalLaF() throws UnsupportedLookAndFeelException {
    1.25 +        UIManager.setLookAndFeel(new MetalLookAndFeel());
    1.26 +    }
    1.27 +
    1.28      @Before
    1.29      public void setUp() {
    1.30          MemoryURL.initialize();