BasicErrorPaneUI extends ErrorPaneUI { @Override public JDialog getErrorDialog(Component owner) { reinit(); expandedHeight = 0; collapsedHeight = 0; Window w = WindowUtils.findWindow(owner); JXErrorDialog dlg = null; if (w instanceof Dialog) { dlg = new JXErrorDialog((Dialog)w, pane); } else if (w instanceof Frame) { dlg = new JXErrorDialog((Frame)w, pane); } else { dlg = new JXErrorDialog(JOptionPane.getRootFrame(), pane); } centerWindow(dlg, owner); return dlg; }  static ComponentUI createUI(JComponent c); @Override void installUI(JComponent c); @Override void uninstallUI(JComponent c); @Override JFrame getErrorFrame(Component owner); @Override JDialog getErrorDialog(Component owner); @Override JInternalFrame getErrorInternalFrame(Component owner); @Override Dimension calculatePreferredSize();  }
@Test public void testGetErrorDialogNull() { if (GraphicsEnvironment.isHeadless()) { LOG.fine("cannot run - headless environment"); return; } assertNotNull(ui.getErrorDialog(null)); }
@Test public void testGetErrorDialogFrame() { if (GraphicsEnvironment.isHeadless()) { LOG.fine("cannot run - headless environment"); return; } assertNotNull(ui.getErrorDialog(new JFrame())); }
@Test public void testGetErrorDialogDialog() { if (GraphicsEnvironment.isHeadless()) { LOG.fine("cannot run - headless environment"); return; } assertNotNull(ui.getErrorDialog(new JDialog())); }
@Test public void testGetErrorDialogContentPane() { if (GraphicsEnvironment.isHeadless()) { LOG.fine("cannot run - headless environment"); return; } JFrame frame = new JFrame(); assertNotNull(ui.getErrorDialog(frame.getContentPane())); }
@Test public void testGetErrorDialogJPanel() { if (GraphicsEnvironment.isHeadless()) { LOG.fine("cannot run - headless environment"); return; } assertNotNull(ui.getErrorDialog(new JPanel())); }
@Test public void testGetErrorDialogApplet() { if (GraphicsEnvironment.isHeadless()) { LOG.fine("cannot run - headless environment"); return; } assertNotNull(ui.getErrorDialog(new Applet())); }
@Test public void testGetErrorDialogJWindow() { if (GraphicsEnvironment.isHeadless()) { LOG.fine("cannot run - headless environment"); return; } assertNotNull(ui.getErrorDialog(new JWindow())); }