JXRootPane extends JRootPane { public JButton getCancelButton() { return cancelButton; } JXRootPane(); @Override void setLayout(LayoutManager layout); void setStatusBar(JXStatusBar statusBar); JXStatusBar getStatusBar(); void setToolBar(JToolBar toolBar); JToolBar getToolBar(); void setCancelButton(JButton cancelButton); JButton getCancelButton();  }
@Test public void testDefaultCancel() { JXRootPane rootPane = new JXRootPane(); assertNull(rootPane.getCancelButton()); Action action = rootPane.getActionMap().get("esc-action"); assertFalse(action.isEnabled()); }