SwingHbox extends AbstractSwingContainer implements XulHbox { @Override public void replaceChild( XulComponent oldElement, XulComponent newElement ) throws XulDomException { this.resetContainer(); super.replaceChild( oldElement, newElement ); } SwingHbox( Element self, XulComponent parent, XulDomContainer domContainer, String tagName ); @Override void removeChild( Element ele ); void resetContainer(); Orient getOrientation(); @Override void replaceChild( XulComponent oldElement, XulComponent newElement ); @Override void layout(); String getBackground(); void setBackground( String src );  }
@Test public void testReplaceChild() throws Exception { XulButton btn = (XulButton) hbox.getElementByXPath( "button" ); XulCheckbox check = (XulCheckbox) hbox.getDocument().createElement( "checkbox" ); hbox.replaceChild( btn, check ); XulCheckbox check2 = (XulCheckbox) hbox.getDocument().getElementByXPath( "/window/hbox/checkbox" ); assertNotNull( check2 ); }