package com.explodingpixels.macwidgets; import java.awt.Window; import javax.swing.*; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.explodingpixels.macwidgets.HudWindow; public class DHudWindowTest { @Before public void setUp() throws Exception { } @Test public void doTest() throws Exception { SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new JFrame(); frame.setSize(400, 400); frame.setVisible(true); JTextField textField = new JTextField("foo bar"); textField.setOpaque(false); HudWindow hud = new HudWindow("Window", frame); hud.getContentPane().add(textField); JDialog dialog = hud.getJDialog(); // WindowUtils.createAndInstallRepaintWindowFocusListener(frame); dialog.setSize(300, 350); dialog.setLocationRelativeTo(null); dialog.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); dialog.setVisible(true); } }); } @After public void tearDown() throws Exception { } }