package com.explodingpixels.macwidgets; import com.explodingpixels.widgets.ImageButton; import javax.swing.*; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.awt.*; public class DImageButtonTest { @Before public void setUp() throws Exception { } @Test public void doTest() throws Exception { SwingUtilities.invokeLater(new Runnable() { public void run() { Icon icon = new ImageIcon( DImageButtonTest.class.getResource("/com/explodingpixels/macwidgets/icons/scroller.png")); Icon pressedIcon = new ImageIcon( DImageButtonTest.class.getResource("/com/explodingpixels/macwidgets/icons/scroller_pressed.png")); Icon mask = new ImageIcon( DImageButtonTest.class.getResource("/com/explodingpixels/macwidgets/icons/scroller_mask.png")); ImageButton button = new ImageButton(icon, mask); button.setPressedIcon(pressedIcon); JFrame frame = new JFrame(); frame.add(button, BorderLayout.CENTER); frame.setSize(150, 100); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setVisible(true); } }); } @After public void tearDown() throws Exception { } }