UIUtils { public static Dimension getScreenSize() { return Toolkit.getDefaultToolkit().getScreenSize(); } private  UIUtils(); static ImageIcon loadImageIcon(String resourcePath); static ImageIcon loadImageIcon(String resourcePath, Class callerClass); static URL getImageURL(String resourcePath); static URL getImageURL(String resourcePath, Class callerClass); static Dimension getScreenSize(); static int getScreenWidth(); static int getScreenHeight(); static void centerComponent(Component comp); static void centerComponent(Component comp, Component alignComp); static void showPopup(JPopupMenu popup, MouseEvent event); static Window getRootWindow(Component component); static Border createGroupBorder(String title); static Frame getRootFrame(Component component); static JFrame getRootJFrame(Component component); static Cursor setRootFrameWaitCursor(Component component); static Cursor setRootFrameDefaultCursor(Component component); static Cursor setRootFrameCursor(Component component, Cursor newCursor); static JMenu findMenu(JMenuBar menuBar, String name, boolean deepSearch); static int findMenuItemPosition(JPopupMenu popupMenu, String name); static JMenu findSubMenu(JPopupMenu popupMenu, String name); static String getUniqueFrameTitle(final JInternalFrame[] frames, final String titleBase); static JSpinner createSpinner(final Parameter param, final Number spinnerStep, final String formatPattern); static JSpinner createDoubleSpinner(final double value, final double rangeMinimum,
                                               final double rangeMaximum,
                                               final double stepSize, final double bigStepSize,
                                               final String formatPattern); static JSpinner createSpinner(final Number value, final Comparable rangeMinimum, final Comparable rangeMaximum,
                                         final Number stepSize, final Number bigStepSize, final String formatPattern); static final String PROPERTY_SOURCE_PRODUCT; static final String IMAGE_RESOURCE_PATH; static final Color COLOR_DARK_RED; static final Color COLOR_DARK_BLUE; static final Color COLOR_DARK_GREEN; }
@Test public void testGetScreenSize() { try { Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); assertNotNull(UIUtils.getScreenSize()); assertEquals(UIUtils.getScreenSize(), screenSize); } catch (HeadlessException e) { warnHeadless(); } }